Skip to content

Commit

Permalink
Fix segment index entry serialize. (#2389)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Co-authored-by: Jin Hai <[email protected]>
  • Loading branch information
small-turtle-1 and JinHai-CN authored Dec 19, 2024
1 parent 6bc1998 commit 5a651bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/storage/meta/entry/segment_index_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1155,8 +1155,8 @@ ChunkIndexEntry *SegmentIndexEntry::GetChunkIndexEntry(ChunkID chunk_id) {
}

nlohmann::json SegmentIndexEntry::Serialize(TxnTimeStamp max_commit_ts) {
if (this->deleted_) {
String error_message = "Segment Column index entry can't be deleted.";
if (CheckDeprecate(max_commit_ts)) {
String error_message = fmt::format("Segment Column index entry deprecate_ts: {}, commit_ts: {}.", deprecate_ts_.load(), max_commit_ts);
UnrecoverableError(error_message);
}

Expand Down
2 changes: 1 addition & 1 deletion src/storage/meta/entry/table_index_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ nlohmann::json TableIndexEntry::Serialize(TxnTimeStamp max_commit_ts) {

std::shared_lock r_lock(rw_locker_);
for (const auto &[segment_id, index_entry] : this->index_by_segment_) {
if (index_entry->commit_ts_ <= max_commit_ts && !index_entry->deleted_) {
if (!index_entry->CheckDeprecate(max_commit_ts)) {
segment_index_entry_candidates.push_back(index_entry);
}
}
Expand Down

0 comments on commit 5a651bf

Please sign in to comment.