Skip to content

Commit

Permalink
replayGetContextLog status handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkr committed Mar 20, 2024
1 parent c53f51b commit d4bd1c5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion db/table_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ bool TableCache::GetFromRowCache(const Slice& user_key, IterKey& row_cache_key,
// If row cache hit, knowing cache key is the same to row_cache_key,
// can use row_cache_key's seq no to construct InternalKey.
replayGetContextLog(*row_cache.Value(row_handle), user_key, get_context,
&value_pinner, seq_no);
&value_pinner, seq_no)
.PermitUncheckedError(); // TODO
RecordTick(ioptions_.stats, ROW_CACHE_HIT);
found = true;
} else {
Expand Down
11 changes: 7 additions & 4 deletions table/get_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,9 @@ void GetContext::push_operand(const Slice& value, Cleanable* value_pinner) {
}
}

void replayGetContextLog(const Slice& replay_log, const Slice& user_key,
GetContext* get_context, Cleanable* value_pinner,
SequenceNumber seq_no) {
Status replayGetContextLog(const Slice& replay_log, const Slice& user_key,
GetContext* get_context, Cleanable* value_pinner,
SequenceNumber seq_no) {
Slice s = replay_log;
Slice ts;
size_t ts_sz = get_context->TimestampSize();
Expand Down Expand Up @@ -612,8 +612,11 @@ void replayGetContextLog(const Slice& replay_log, const Slice& user_key,

Status read_status;
get_context->SaveValue(ikey, value, &dont_care, &read_status, value_pinner);
read_status.PermitUncheckedError(); // TODO
if (!read_status.ok()) {
return read_status;
}
}
return Status::OK();
}

} // namespace ROCKSDB_NAMESPACE
8 changes: 4 additions & 4 deletions table/get_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ class GetContext {
// Call this to replay a log and bring the get_context up to date. The replay
// log must have been created by another GetContext object, whose replay log
// must have been set by calling GetContext::SetReplayLog().
void replayGetContextLog(const Slice& replay_log, const Slice& user_key,
GetContext* get_context,
Cleanable* value_pinner = nullptr,
SequenceNumber seq_no = kMaxSequenceNumber);
Status replayGetContextLog(const Slice& replay_log, const Slice& user_key,
GetContext* get_context,
Cleanable* value_pinner = nullptr,
SequenceNumber seq_no = kMaxSequenceNumber);

} // namespace ROCKSDB_NAMESPACE

0 comments on commit d4bd1c5

Please sign in to comment.