Skip to content

Commit

Permalink
[chore][store] Adjust some log.
Browse files Browse the repository at this point in the history
  • Loading branch information
rock-git authored and ketor committed Dec 5, 2023
1 parent d4540b3 commit f651b00
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/handler/raft_apply_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ int CommitMergeHandler::Handle(std::shared_ptr<Context>, store::RegionPtr target
assert(raft_store_engine != nullptr);

DINGO_LOG(INFO) << fmt::format(
"[merge.merging][job_id({}).region({}/{})] Apply CommitMerge, source_region({}/{}/{}) target_region({}/{}).",
"[merge.merging][job_id({}).region({}/{})] Appling CommitMerge, source_region({}/{}/{}) target_region({}/{}).",
request.job_id(), request.source_region_id(), target_region->Id(),
Helper::RegionEpochToString(request.source_region_epoch()), Helper::RangeToString(request.source_region_range()),
request.entries().size(), target_region->EpochToString(), target_region->RangeToString());
Expand All @@ -754,7 +754,7 @@ int CommitMergeHandler::Handle(std::shared_ptr<Context>, store::RegionPtr target
auto source_region = store_region_meta->GetRegion(request.source_region_id());
if (source_region == nullptr) {
DINGO_LOG(FATAL) << fmt::format(
"[merge.merging][job_id({}).region({}/{})] Appling CommitMerge, source region is nullptr.", request.job_id(),
"[merge.merging][job_id({}).region({}/{})] Apply CommitMerge, source region is nullptr.", request.job_id(),
request.source_region_id(), target_region->Id());
return 0;
}
Expand Down
10 changes: 8 additions & 2 deletions src/vector/vector_index_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ butil::Status VectorIndexManager::CatchUpLogToVectorIndex(VectorIndexWrapperPtr
return butil::Status(pb::error::ERAFT_META_NOT_FOUND, "not found raft meta.");
}

for (int i = i;; ++i) {
for (int i = 0;; ++i) {
int64_t start_log_id = vector_index->ApplyLogId() + 1;
int64_t end_log_id = raft_meta->AppliedId();
if (end_log_id - start_log_id < FLAGS_catchup_log_min_gap) {
Expand Down Expand Up @@ -823,13 +823,19 @@ butil::Status VectorIndexManager::CatchUpLogToVectorIndex(VectorIndexWrapperPtr
ON_SCOPE_EXIT([&]() { vector_index_wrapper->SetIsSwitchingVectorIndex(false); });

start_time = Helper::TimestampMs();
int64_t start_log_id = vector_index->ApplyLogId() + 1;
int64_t end_log_id = raft_meta->AppliedId();
// second ground replay wal
auto status = ReplayWalToVectorIndex(vector_index, vector_index->ApplyLogId() + 1, raft_meta->AppliedId());
auto status = ReplayWalToVectorIndex(vector_index, start_log_id, end_log_id);
if (!status.ok()) {
vector_index_wrapper->SetRebuildError();
return status;
}

DINGO_LOG(INFO) << fmt::format(
"[vector_index.catchup][index_id({})][trace({})] Catch up last-round({}-{}) success.", vector_index_id, trace,
start_log_id, end_log_id);

vector_index_wrapper->UpdateVectorIndex(vector_index, trace);
vector_index_wrapper->SetRebuildSuccess();
}
Expand Down
7 changes: 0 additions & 7 deletions src/vector/vector_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,6 @@ butil::Status VectorReader::VectorGetRegionMetrics(int64_t /*region_id*/, const
}

butil::Status VectorReader::VectorCount(const pb::common::Range& range, int64_t& count) {
// std::string begin_key = VectorCodec::FillVectorTablePrefix(range.start_key());
// std::string end_key = VectorCodec::FillVectorTablePrefix(range.end_key());
const std::string& begin_key = range.start_key();
const std::string& end_key = range.end_key();

Expand All @@ -532,8 +530,6 @@ butil::Status VectorReader::VectorCount(const pb::common::Range& range, int64_t&

// GetBorderId
butil::Status VectorReader::GetBorderId(const pb::common::Range& region_range, bool get_min, int64_t& vector_id) {
// std::string start_key = VectorCodec::FillVectorDataPrefix(region_range.start_key());
// std::string end_key = VectorCodec::FillVectorDataPrefix(region_range.end_key());
const std::string& start_key = region_range.start_key();
const std::string& end_key = region_range.end_key();

Expand Down Expand Up @@ -591,9 +587,6 @@ butil::Status VectorReader::GetBorderId(const pb::common::Range& region_range, b
butil::Status VectorReader::ScanVectorId(std::shared_ptr<Engine::VectorReader::Context> ctx,
std::vector<int64_t>& vector_ids) {
std::string seek_key;
// VectorCodec::EncodeVectorData(ctx->partition_id, ctx->start_id, seek_key);
// std::string range_start_key = VectorCodec::FillVectorDataPrefix(ctx->region_range.start_key());
// std::string range_end_key = VectorCodec::FillVectorDataPrefix(ctx->region_range.end_key());
VectorCodec::EncodeVectorKey(ctx->region_range.start_key()[0], ctx->partition_id, ctx->start_id, seek_key);
std::string range_start_key = ctx->region_range.start_key();
std::string range_end_key = ctx->region_range.end_key();
Expand Down

0 comments on commit f651b00

Please sign in to comment.