Skip to content
Open
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
3 changes: 2 additions & 1 deletion tx_service/include/cc/object_cc_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,8 @@ class ObjectCcMap : public TemplateCcMap<KeyT, ValueT, false, false>
decoded_key.Deserialize(key_str->data(), offset, KeySchema());
const KeyT *look_key = &decoded_key;

if (Sharder::Instance().StandbyNodeTerm() >= 0 &&
if ((Sharder::Instance().StandbyNodeTerm() >= 0 ||
Sharder::Instance().CandidateStandbyNodeTerm() >= 0) &&
Sharder::Instance().GetDataStoreHandler()->IsSharedStorage() &&
commit_ts < Sharder::Instance().NativeNodeGroupCkptTs())
{
Comment on lines +1912 to 1916
Expand Down
10 changes: 8 additions & 2 deletions tx_service/src/cc/cc_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,16 @@ void VersionedLruEntry<Versioned, RangePartitioned>::SetCommitTsPayloadStatus(
template <bool Versioned, bool RangePartitioned>
bool VersionedLruEntry<Versioned, RangePartitioned>::IsPersistent() const
{
if (Sharder::Instance().StandbyNodeTerm() >= 0 &&
const int64_t standby_term = Sharder::Instance().StandbyNodeTerm();
const int64_t candidate_standby_term =
Sharder::Instance().CandidateStandbyNodeTerm();
if ((standby_term >= 0 || candidate_standby_term >= 0) &&
Sharder::Instance().GetDataStoreHandler()->IsSharedStorage())
{
// If this is a follower with shared kv, check the ng leader's ckpt_ts.
// For shared-storage standby cache, entries are persistent once the
// primary's checkpoint ts has advanced past the entry's commit ts. This
// must apply during candidate-standby as well, otherwise entries loaded
// while following cannot be reclaimed before snapshot sync finishes.
return CommitTs() <= Sharder::Instance().NativeNodeGroupCkptTs();
}

Expand Down