Thread (32 messages) 32 messages, 3 authors, 2024-02-15
STALE859d

[PATCH v3 2/8] reftable/stack: do not auto-compact twice in `reftable_stack_add()`

From: Patrick Steinhardt <hidden>
Date: 2024-01-03 06:22:20
Subsystem: the rest · Maintainer: Linus Torvalds

In 5c086453ff (reftable/stack: perform auto-compaction with
transactional interface, 2023-12-11), we fixed a bug where the
transactional interface to add changes to a reftable stack did not
perform auto-compaction by calling `reftable_stack_auto_compact()` in
`reftable_stack_addition_commit()`. While correct, this change may now
cause us to perform auto-compaction twice in the non-transactional
interface `reftable_stack_add()`:

  - It performs auto-compaction by itself.

  - It now transitively performs auto-compaction via the transactional
    interface.

Remove the first instance so that we only end up doing auto-compaction
once.

Reported-by: Han-Wen Nienhuys <redacted>
Signed-off-by: Patrick Steinhardt <redacted>
---
 reftable/stack.c | 3 ---
 1 file changed, 3 deletions(-)
diff --git a/reftable/stack.c b/reftable/stack.c
index 8729508dc3..7ffeb3ee10 100644
--- a/reftable/stack.c
+++ b/reftable/stack.c
@@ -425,9 +425,6 @@ int reftable_stack_add(struct reftable_stack *st,
 		return err;
 	}
 
-	if (!st->disable_auto_compact)
-		return reftable_stack_auto_compact(st);
-
 	return 0;
 }
 
-- 
2.43.GIT

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help