forked from etcd-io/etcd
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add robustness test for issue 17780
Closes etcd-io#17780 Signed-off-by: Wei Fu <[email protected]>
- Loading branch information
Showing
4 changed files
with
89 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tests/robustness/patches/compactBeforeSetFinishedCompact/kvstore_compaction.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
From 6b034466aa0ac2b46fe01fb5bd2233946f46d453 Mon Sep 17 00:00:00 2001 | ||
From: Wei Fu <[email protected]> | ||
Date: Wed, 24 Apr 2024 12:14:27 +0800 | ||
Subject: [PATCH] server/mvcc: introduce compactBeforeSetFinishedCompact | ||
failpoint | ||
|
||
Signed-off-by: Wei Fu <[email protected]> | ||
--- | ||
server/mvcc/kvstore_compaction.go | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/server/mvcc/kvstore_compaction.go b/server/mvcc/kvstore_compaction.go | ||
index c7d343d5c..89defbd9e 100644 | ||
--- a/server/mvcc/kvstore_compaction.go | ||
+++ b/server/mvcc/kvstore_compaction.go | ||
@@ -59,6 +59,7 @@ func (s *store) scheduleCompaction(compactMainRev, prevCompactRev int64) (KeyVal | ||
} | ||
|
||
if len(keys) < s.cfg.CompactionBatchLimit { | ||
+ // gofail: var compactBeforeSetFinishedCompact struct{} | ||
rbytes := make([]byte, 8+1+8) | ||
revToBytes(revision{main: compactMainRev}, rbytes) | ||
tx.UnsafePut(buckets.Meta, finishedCompactKeyName, rbytes) | ||
-- | ||
2.34.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters