Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: reduce the scope of the meta server cache #2736

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/common/meta/src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,9 +660,7 @@ impl TableMetadataManager {
.table_route_manager()
.build_update_txn(table_id, &current_table_route_value, &new_table_route_value)?;

let txn = Txn::merge_all(vec![update_table_route_txn]);

let r = self.kv_backend.txn(txn).await?;
let r = self.kv_backend.txn(update_table_route_txn).await?;

// Checks whether metadata was already updated.
if !r.succeeded {
Expand Down
5 changes: 3 additions & 2 deletions src/meta-srv/src/metasrv/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ impl MetaSrvBuilder {
state.clone(),
kv_backend.clone(),
));
let kv_backend = leader_cached_kv_backend.clone() as _;

let meta_peer_client = meta_peer_client
.unwrap_or_else(|| build_default_meta_peer_client(&election, &in_memory));
Expand All @@ -177,7 +176,9 @@ impl MetaSrvBuilder {
let mailbox = build_mailbox(&kv_backend, &pushers);
let procedure_manager = build_procedure_manager(&options, &kv_backend);
let table_id_sequence = Arc::new(Sequence::new(TABLE_ID_SEQ, 1024, 10, kv_backend.clone()));
let table_metadata_manager = Arc::new(TableMetadataManager::new(kv_backend.clone()));
let table_metadata_manager = Arc::new(TableMetadataManager::new(
leader_cached_kv_backend.clone() as _,
));
let lock = lock.unwrap_or_else(|| Arc::new(MemLock::default()));
let selector_ctx = SelectorContext {
server_addr: options.server_addr.clone(),
Expand Down
Loading