From 290ad15c95ffece76bebd729edc5a929259a2a74 Mon Sep 17 00:00:00 2001 From: Karthik Nayak Date: Wed, 15 Jan 2025 11:54:51 +0000 Subject: [PATCH] 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 Signed-off-by: Johannes Schindelin --- refs/reftable-backend.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/refs/reftable-backend.c b/refs/reftable-backend.c index 9cfb0cb26721a9..d26b5bf85c9b2c 100644 --- a/refs/reftable-backend.c +++ b/refs/reftable-backend.c @@ -1020,6 +1020,7 @@ static int prepare_transaction_update(struct write_transaction_table_arg **out, arg->updates_nr = 0; arg->updates_alloc = 0; arg->updates_expected = 0; + arg->max_index = 0; } arg->updates_expected++; @@ -1634,6 +1635,8 @@ static int reftable_be_transaction_finish(struct ref_store *ref_store UNUSED, tx_data->args->max_index = transaction->max_index; for (size_t i = 0; i < tx_data->args_nr; i++) { + tx_data->args[i].max_index = transaction->max_index; + ret = reftable_addition_add(tx_data->args[i].addition, write_transaction_table, &tx_data->args[i]); if (ret < 0)