Skip to content

Commit 26f45f4

Browse files
committed
{183109183} Fix durable chunk issue
Signed-off-by: Salil Chandra <schandra107@bloomberg.net>
1 parent 036f22c commit 26f45f4

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

db/toblock.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,9 @@ static int do_replay_case(struct ireq *iq, void *fstseqnum, int seqlen,
12181218
* This can incorrectly report NOT_DURABLE but that's sane given that half
12191219
* the cluster is incoherent */
12201220
int is_final = iq->sorese ? iq->sorese->is_final : 0;
1221-
int non_durable_retry = gbl_replicant_retry_on_not_durable && (!is_final || !gbl_ignore_final_non_durable_retry);
1221+
int can_replicant_retry = IQ_HAS_SNAPINFO(iq) && IQ_SNAPINFO(iq)->replicant_is_able_to_retry;
1222+
int non_durable_retry =
1223+
gbl_replicant_retry_on_not_durable && can_replicant_retry && (!is_final || !gbl_ignore_final_non_durable_retry);
12221224
int force_non_durable = non_durable_retry && gbl_debug_force_non_durable;
12231225

12241226
if ((bdb_attr_get(thedb->bdb_attr, BDB_ATTR_DURABLE_LSNS) || non_durable_retry) &&
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
Verify non-durable requests behavior against hide_non_durable_rcode
1+
Verify non-durable requests behavior against hide_non_durable_rcode.
2+
Also verifies chunk transactions do not fail with in-transaction disconnect
3+
when non-durable replay forcing is enabled.

tests/final_non_durable_retry.test/runit

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,36 @@ function hide_non_durable_constraint_violation
121121
$CDB2SQL_EXE $CDB2_OPTIONS $DBNAME default "delete from t1 where 1" >/dev/null 2>&1
122122
}
123123

124+
function show_non_durable_chunk_does_not_disconnect
125+
{
126+
hide_non_durable_rcode 0
127+
force_all_non_durable 1
128+
129+
$CDB2SQL_EXE $CDB2_OPTIONS $DBNAME default - <<EOF
130+
set transaction chunk 1
131+
begin
132+
$(for i in $(seq 2001 2050); do
133+
echo "insert into t1 values ($i)"
134+
done)
135+
commit
136+
EOF
137+
rc=$?
138+
139+
[[ $rc -ne 0 ]] &&
140+
failexit "chunk transaction should finish commit successfully (rc=$rc)"
141+
142+
hide_non_durable_rcode 0
143+
force_all_non_durable 0
144+
$CDB2SQL_EXE $CDB2_OPTIONS $DBNAME default "delete from t1 where a between 2001 and 2050" >/dev/null 2>&1
145+
}
146+
124147
function run_test
125148
{
126149
hide_non_durable_good_insert
127150
show_non_durable_good_insert
128151
hide_non_durable_constraint_violation
129152
show_non_durable_constraint_violation
153+
show_non_durable_chunk_does_not_disconnect
130154
}
131155

132156
create_table

0 commit comments

Comments
 (0)