zhannngchen commented on code in PR #43509: URL: https://github.com/apache/doris/pull/43509#discussion_r1834163153
########## cloud/src/meta-service/meta_service.cpp: ########## @@ -1923,11 +1925,37 @@ void MetaServiceImpl::get_delete_bitmap(google::protobuf::RpcController* control std::unique_ptr<RangeGetIterator> it; int64_t last_ver = -1; int64_t last_seg_id = -1; + int64_t round = 0; do { - err = txn->get(start_key, end_key, &it); +#ifdef UNIT_TEST + err = txn->get(start_key, end_key, &it, true, 2); +#else + err = txn->get(start_key, end_key, &it, true); +#endif + TEST_SYNC_POINT_CALLBACK("get_delete_bitmap_err", &round, &err); + while (err == TxnErrorCode::TXN_TOO_OLD && + retry < config::max_get_delete_bitmap_retry_times) { + LOG(INFO) << "retry get delete bitmap, code=" << MetaServiceCode_Name(code) + << ", retry=" << retry << ", internal round=" << round; + txn = nullptr; + err = txn_kv_->create_txn(&txn); + if (err != TxnErrorCode::TXN_OK) { + code = cast_as<ErrCategory::CREATE>(err); + ss << "failed to init txn, retry=" << retry << ", internal round=" << round; + msg = ss.str(); + return; + } +#ifdef UNIT_TEST + err = txn->get(start_key, end_key, &it, true, 2); Review Comment: make sure all delete bitmap keys are committed before rowset keys, so that the snapshot read won't miss data. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org