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

Fix segment index entry serialize. #2389

Merged
merged 3 commits into from
Dec 19, 2024
Merged
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: 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