Skip to content

Commit f4924ec

Browse files
Timclaude
andcommitted
test/crash_recovery_test_28: allow autocommitted-but-uncommitted row, mirror test_10
Same race the test_10 relaxation in 14e0659 already documented: each loop iteration is "INSERT; dolt_commit('-A','-m',...)". The INSERT autocommits at the SQL layer before the surrounding dolt_commit() runs, so SIGKILL landing between them leaves a durable row in the working set that no Dolt commit was ever recorded for. After recovery, nRows == nLog + 1 is a legitimate state, not a corruption. Test_10 had the identical "INSERT; dolt_commit" shape and was relaxed exactly this way; test_28 was missed in that pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e9e8781 commit f4924ec

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

test/crash_recovery_test.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,12 @@ static void test_28_rapid_small_commits(void){
17401740
check("test_28: commit count in [0..10]", nLog>=0 && nLog<=10);
17411741
if( nLog>0 ){
17421742
int nRows = exec_int(db, "SELECT count(*) FROM t", -1);
1743-
check("test_28: rows match commits", nRows==nLog);
1743+
/* INSERT autocommits before the surrounding dolt_commit() runs;
1744+
** SIGKILL can land in the gap, leaving the row durable in the
1745+
** working set but no Dolt commit recorded for it (same race as
1746+
** test_10). */
1747+
check("test_28: rows match commits or next insert",
1748+
nRows==nLog || nRows==nLog+1);
17441749
}
17451750
}
17461751
sqlite3_close(db);

0 commit comments

Comments
 (0)