Skip to content

Commit 14e0659

Browse files
committed
Relax early crash row-count invariant
1 parent bafbc3f commit 14e0659

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
@@ -748,7 +748,12 @@ static void test_10_very_early_kill(void){
748748
check("test_10: commit count non-negative", nLog>=0);
749749
if( nLog>0 ){
750750
int nRows = exec_int(db, "SELECT count(*) FROM t", -1);
751-
check("test_10: row count matches commits", nRows==nLog);
751+
/* The INSERT for the next would-be commit may already have
752+
** autocommitted before the process is killed inside
753+
** dolt_commit(). In that case recovery can legitimately see one
754+
** extra row beyond the durable Dolt commit count. */
755+
check("test_10: row count matches commits or next insert",
756+
nRows==nLog || nRows==nLog+1);
752757
}
753758
}else{
754759
/* If we killed before the file was created, that's OK. */

0 commit comments

Comments
 (0)