Skip to content

Commit 290ad15

Browse files
KarthikNayakdscho
authored andcommitted
fixup! reftable: write correct max_update_index to header
The original commit was missing some initializations. This lead to the somewhat intuitive (and not reliably reproducible, until the trick was found to use `sanitize=address,undefined`) symptom that t1400.249 and/or t2400.171 failed with: Assertion failed: (ret != REFTABLE_API_ERROR), function reftable_be_transaction_finish, file reftable-backend.c, line 1648. or Assertion failed: (ret != REFTABLE_API_ERROR), function write_transaction_table, file reftable-backend.c, line 1619. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 14ed4ad commit 290ad15

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

refs/reftable-backend.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@ static int prepare_transaction_update(struct write_transaction_table_arg **out,
10201020
arg->updates_nr = 0;
10211021
arg->updates_alloc = 0;
10221022
arg->updates_expected = 0;
1023+
arg->max_index = 0;
10231024
}
10241025

10251026
arg->updates_expected++;
@@ -1634,6 +1635,8 @@ static int reftable_be_transaction_finish(struct ref_store *ref_store UNUSED,
16341635
tx_data->args->max_index = transaction->max_index;
16351636

16361637
for (size_t i = 0; i < tx_data->args_nr; i++) {
1638+
tx_data->args[i].max_index = transaction->max_index;
1639+
16371640
ret = reftable_addition_add(tx_data->args[i].addition,
16381641
write_transaction_table, &tx_data->args[i]);
16391642
if (ret < 0)

0 commit comments

Comments
 (0)