Take the read-back back out of the persist; a write verdict belongs only where evidence crosses the plugin boundary
Its false gated six undo points, so an unverified byte-equality assumption could have silently removed Ctrl-Z for a bank mutation that landed.
This commit is contained in:
@@ -139,17 +139,16 @@ wire::BakeWriteProof writeBackOne(ScannedKey& entry, bool persisted) {
|
||||
std::string value; // empty = clear the key
|
||||
if (entry.write == ScannedKey::Write::Answer) {
|
||||
// Where a landing earns the word: the pass's persist runs after the whole scan,
|
||||
// so until here nothing had observed whether the project took it. Without it
|
||||
// the entry lives in memory alone, which is a failed bake to anyone who
|
||||
// reloads — so it is answered as one rather than as an Ok.
|
||||
// so until here no bank write had been issued for it at all. Without one the
|
||||
// entry lives in memory alone, which is a failed bake to anyone who reloads —
|
||||
// so it is answered as one rather than as an Ok.
|
||||
const wire::BakeLanding after =
|
||||
wire::bakeLandingAfterPersist(entry.report.landing, persisted);
|
||||
if (after == wire::BakeLanding::Unpersisted) {
|
||||
entry.outcome = refuseBake(
|
||||
BakeStatus::Failed,
|
||||
"the bake reached the bank in memory, but this pass's persist did not "
|
||||
"confirm its bank write, so this answer cannot promise a reload will "
|
||||
"find it",
|
||||
"report success, so this answer cannot promise a reload will find it",
|
||||
entry.outcome.generation);
|
||||
// `detail` left empty on purpose: describeLanding's Unpersisted clause is
|
||||
// that sentence's one home on the console side, and the message above is
|
||||
@@ -196,7 +195,7 @@ void RunResampleBake(ReaSamplerSession& session) {
|
||||
std::vector<ScannedKey> scanned;
|
||||
wire::BakeScanTally tally; // every verdict below is counted, skips included
|
||||
std::string aborted; // set only when the scan itself threw
|
||||
bool persisted = false; // the pass's ONE persist confirmed its bank write
|
||||
bool persisted = false; // the pass's ONE persist ran and reported success
|
||||
bool bookChanged = false; // some landing added or refreshed an entry
|
||||
// A local, not a tally field: an entry counted here can still be re-answered as a
|
||||
// failure by the write-back loop below, so this is a persist GATE and never a count
|
||||
|
||||
Reference in New Issue
Block a user