Skip to content

Commit b3c9665

Browse files
committed
Check if (maybe) just created TPB block was not become outdated during its creation.
1 parent 24889a6 commit b3c9665

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/jrd/tpc.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,17 @@ CommitNumber TipCache::cacheState(TraNumber number)
215215
if (!block)
216216
return CN_PREHISTORIC;
217217

218+
// Check if the block is not obsolete at the moment
219+
oldest = header->oldest_transaction.load(std::memory_order_relaxed);
220+
221+
if (number < oldest)
222+
{
223+
gds__log("Re-created obsolete TPC block %u. For transaction %" UQUADFORMAT ", oldest %." UQUADFORMAT,
224+
blockNumber, number, oldest);
225+
226+
return CN_PREHISTORIC;
227+
}
228+
218229
// Barrier is not needed here when we are reading state from cache
219230
// because all callers of this function are prepared to handle
220231
// slightly out-dated information and will take slow path if necessary

0 commit comments

Comments
 (0)