-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Cursors, Layered Tables
-
None
-
Storage Engines - Foundations
-
None
-
None
If we have never picked up a checkpoint on the standby, we will open an empty live btree cursor instead.
if (ret == WT_NOTFOUND) {
/*
* We've never picked up a checkpoint, open a regular btree on the stable URI. If we're
* a follower and we never picked up a checkpoint, then no checkpoint has ever occurred
* on this Btree. Everything we need will be satisfied by the ingest table until the
* next checkpoint is picked up. So technically, opening this (empty) stable table is
* wasteful, but it's a corner case, it will be resolved at the next checkpoint, and it
* keeps the code easy.
*
* TODO: how to close this dhandle later as it is a live btree handle? We may get this
* dhandle when the node steps up.
*/
cfg[2] = "read_only=true";
F_SET(clayered, WT_CLAYERED_STABLE_NO_CKPT);
}
This is wrong as we don't have a way to close the dhandle once we have picked up a new checkpoint. After the standby steps up, we may mistakenly thinks this empty dhandle is the "real" live dhandle of the btree.
We should never open a live btree dhandle on standby. Instead, we need to check whether the stable table is NULL instead.