Skip to content

Commit 282de53

Browse files
committedFeb 27, 2025·
ms upgrade
1 parent 2434854 commit 282de53

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎cloud/src/meta-service/meta_service.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -2318,6 +2318,16 @@ void MetaServiceImpl::get_delete_bitmap_update_lock(google::protobuf::RpcControl
23182318
lock_info.set_expiration(expiration);
23192319
lock_info.add_initiators(request->initiator());
23202320
} else {
2321+
// in normal case, this should remove 0 kvs
2322+
// but when upgrade ms, if there are ms with old and new versions, it works
2323+
std::string tablet_compaction_key_begin =
2324+
mow_tablet_compaction_key({instance_id, table_id, 0});
2325+
std::string tablet_compaction_key_end =
2326+
mow_tablet_compaction_key({instance_id, table_id, INT64_MAX});
2327+
txn->remove(tablet_compaction_key_begin, tablet_compaction_key_end);
2328+
LOG(INFO) << "remove mow tablet compaction kv, begin="
2329+
<< hex(tablet_compaction_key_begin)
2330+
<< " end=" << hex(tablet_compaction_key_end) << " table_id=" << table_id;
23212331
if (!put_mow_tablet_compaction_key(code, msg, txn, instance_id, table_id,
23222332
request->lock_id(), request->initiator(),
23232333
expiration, current_lock_msg)) {

0 commit comments

Comments
 (0)