box: handle cancelling fiber waiting in wal queue#11273
Merged
sergepetrenko merged 1 commit intotarantool:masterfrom Mar 21, 2025
Merged
box: handle cancelling fiber waiting in wal queue#11273sergepetrenko merged 1 commit intotarantool:masterfrom
sergepetrenko merged 1 commit intotarantool:masterfrom
Conversation
xuniq
approved these changes
Mar 19, 2025
locker
reviewed
Mar 19, 2025
sergepetrenko
requested changes
Mar 20, 2025
Collaborator
sergepetrenko
left a comment
There was a problem hiding this comment.
Thanks for the patch!
Just one question.
sergepetrenko
approved these changes
Mar 20, 2025
locker
approved these changes
Mar 20, 2025
Contributor
Author
|
Fixed a few nits. diffdiff --git a/src/box/journal.c b/src/box/journal.c
index b1064c9c93..fcfb492117 100644
--- a/src/box/journal.c
+++ b/src/box/journal.c
@@ -123,7 +123,7 @@ journal_queue_wait(struct journal_entry *entry)
struct stailq rollback;
stailq_cut_tail(&journal_queue.requests, &prev_entry->fifo,
&rollback);
- /* Pop this entry. */
+ /* Pop this request. */
VERIFY(stailq_shift_entry(&rollback,
typeof(*entry), fifo) == entry);
stailq_reverse(&rollback);
diff --git a/src/box/journal.h b/src/box/journal.h
index d77434266d..d70b861151 100644
--- a/src/box/journal.h
+++ b/src/box/journal.h
@@ -202,7 +202,7 @@ journal_queue_is_full(void)
int
journal_queue_wait(struct journal_entry *entry);
-/** Empty the queue by waking everyone in it up and put self to queue tail. */
+/** Flush journal queue. Next wal_sync() will sync flushed requests. */
void
journal_queue_flush(void);
diff --git a/test/box-luatest/gh_11078_wal_queue_fiber_cancel_test.lua b/test/box-lua>
index 85b1225f06..12daacc644 100644
--- a/test/box-luatest/gh_11078_wal_queue_fiber_cancel_test.lua
+++ b/test/box-luatest/gh_11078_wal_queue_fiber_cancel_test.lua
@@ -18,8 +18,8 @@ g.after_all(function(cg)
end)
g.after_each(function(cg)
- box.error.injection.set('ERRINJ_WAL_DELAY', false)
cg.server:exec(function()
+ box.error.injection.set('ERRINJ_WAL_DELAY', false)
box.space.test:drop()
end)
end) |
Currently if fiber waiting in WAL queue is cancelled it will go on
writing request to WAL breaking queue order. So WAL is corrupted so that
even next Tarantool restart may fail. Unfortunately we cancel fibers on
Tarantool shutdown so the issue may arise just buy terminating Tarantool
instance.
Let's instead fail the cancelled request and all the newer request in
the queue.
Work around is to disable WAL queue by `box.cfg{wal_queue_max_size = 0}`
so that only one write request can be in the queue.
Closes tarantool#11078
NO_DOC=bugfix
195565b to
6dbbd02
Compare
Collaborator
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release/2.11
git worktree add -d .worktree/backport/release/2.11/11273 origin/release/2.11
cd .worktree/backport/release/2.11/11273
git switch --create backport/release/2.11/11273
git cherry-pick -x def445684df0d4b847292767b92c02adba51074b |
Collaborator
|
Successfully created backport PR for |
Collaborator
|
Successfully created backport PR for |
Collaborator
Backport summary
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently if fiber waiting in wal queue is cancelled it will go on writing to all breaking queue order. So wal is corrupted so that even next Tarantool restart may fail. Unfortunately we cancel fibers on Tarantool shutdown so the issue may arise just buy terminating Tarantool instance.
Let's instead fail the cancelled request and all the newer request in the queue.
Work around is to disable wal queue by
box.cfg{wal_queue_max_size = 0}so that only one write request can be in the queue.Closes #11078