-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix Flaky-test: testBookieContinueWritingIfMultipleLedgersPresent #3421
Merged
hangc0276
merged 1 commit into
apache:master
from
wenbingshen:fixFlakyTestWritingMultipleLedgers
Jul 26, 2022
Merged
fix Flaky-test: testBookieContinueWritingIfMultipleLedgersPresent #3421
hangc0276
merged 1 commit into
apache:master
from
wenbingshen:fixFlakyTestWritingMultipleLedgers
Jul 26, 2022
Conversation
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
ping @hangc0276 @dlg99 @shoothzj @eolivelli PTAL. |
shoothzj
approved these changes
Jul 24, 2022
dlg99
approved these changes
Jul 25, 2022
hangc0276
approved these changes
Jul 26, 2022
zymap
pushed a commit
that referenced
this pull request
Aug 2, 2022
### Motivation Fixes issue #2665 When the disk is full, `InterleavedLedgerStorage` creates a new entryLog and index file, copies and moves the old index (newFile) `FileInfo` to the new directory, and finally deletes the old index file. The old file of `FileInfo` was `deleted`, but it was copied and moved a newFile to the new directory. Therefore, the delete status flag should be restored. If it is not set to false,`checkOpen` will throw `FileInfoDeletedException` when judging the fence status of `ledgerHandle` when adding an entry, causing the writing to fail. When the client changes the `ensemble`, it throws an exception because the test has only two bookie nodes and cannot satisfy the two writeSet: `Not enough non-faulty bookies available`. ```java public synchronized boolean isFenced() throws IOException { checkOpen(false); return (stateBits & STATE_FENCED_BIT) == STATE_FENCED_BIT; } private synchronized void checkOpen(boolean create, boolean openBeforeClose) throws IOException { if (deleted) { throw new FileInfoDeletedException(); } ..... } ``` ### Changes When `FileInfo` moves to a new directory by `moveToNewLocation`,delete the old index file and restore the `delete` flag, because the new index file is ready. Set the disk check interval to the `Integer.MAX_VALUE`, which is stable `assertEquals("writable dirs should have one dir", 1, ledgerDirsManager .getWritableLedgerDirs().size());` Because once the test thrashes, the disk check thread will restore the full disk to a writable state. ```java newConf.setDiskCheckInterval(Integer.MAX_VALUE); ``` (cherry picked from commit 1908b7e)
hangc0276
pushed a commit
to hangc0276/bookkeeper
that referenced
this pull request
Nov 5, 2022
…#3421) Fixes issue apache#2665 When the disk is full, `InterleavedLedgerStorage` creates a new entryLog and index file, copies and moves the old index (newFile) `FileInfo` to the new directory, and finally deletes the old index file. The old file of `FileInfo` was `deleted`, but it was copied and moved a newFile to the new directory. Therefore, the delete status flag should be restored. If it is not set to false,`checkOpen` will throw `FileInfoDeletedException` when judging the fence status of `ledgerHandle` when adding an entry, causing the writing to fail. When the client changes the `ensemble`, it throws an exception because the test has only two bookie nodes and cannot satisfy the two writeSet: `Not enough non-faulty bookies available`. ```java public synchronized boolean isFenced() throws IOException { checkOpen(false); return (stateBits & STATE_FENCED_BIT) == STATE_FENCED_BIT; } private synchronized void checkOpen(boolean create, boolean openBeforeClose) throws IOException { if (deleted) { throw new FileInfoDeletedException(); } ..... } ``` When `FileInfo` moves to a new directory by `moveToNewLocation`,delete the old index file and restore the `delete` flag, because the new index file is ready. Set the disk check interval to the `Integer.MAX_VALUE`, which is stable `assertEquals("writable dirs should have one dir", 1, ledgerDirsManager .getWritableLedgerDirs().size());` Because once the test thrashes, the disk check thread will restore the full disk to a writable state. ```java newConf.setDiskCheckInterval(Integer.MAX_VALUE); ``` (cherry picked from commit 1908b7e)
hangc0276
pushed a commit
to hangc0276/bookkeeper
that referenced
this pull request
Nov 7, 2022
…#3421) Fixes issue apache#2665 When the disk is full, `InterleavedLedgerStorage` creates a new entryLog and index file, copies and moves the old index (newFile) `FileInfo` to the new directory, and finally deletes the old index file. The old file of `FileInfo` was `deleted`, but it was copied and moved a newFile to the new directory. Therefore, the delete status flag should be restored. If it is not set to false,`checkOpen` will throw `FileInfoDeletedException` when judging the fence status of `ledgerHandle` when adding an entry, causing the writing to fail. When the client changes the `ensemble`, it throws an exception because the test has only two bookie nodes and cannot satisfy the two writeSet: `Not enough non-faulty bookies available`. ```java public synchronized boolean isFenced() throws IOException { checkOpen(false); return (stateBits & STATE_FENCED_BIT) == STATE_FENCED_BIT; } private synchronized void checkOpen(boolean create, boolean openBeforeClose) throws IOException { if (deleted) { throw new FileInfoDeletedException(); } ..... } ``` When `FileInfo` moves to a new directory by `moveToNewLocation`,delete the old index file and restore the `delete` flag, because the new index file is ready. Set the disk check interval to the `Integer.MAX_VALUE`, which is stable `assertEquals("writable dirs should have one dir", 1, ledgerDirsManager .getWritableLedgerDirs().size());` Because once the test thrashes, the disk check thread will restore the full disk to a writable state. ```java newConf.setDiskCheckInterval(Integer.MAX_VALUE); ``` (cherry picked from commit 1908b7e)
nicoloboschi
pushed a commit
to datastax/bookkeeper
that referenced
this pull request
Jan 11, 2023
…#3421) Fixes issue apache#2665 When the disk is full, `InterleavedLedgerStorage` creates a new entryLog and index file, copies and moves the old index (newFile) `FileInfo` to the new directory, and finally deletes the old index file. The old file of `FileInfo` was `deleted`, but it was copied and moved a newFile to the new directory. Therefore, the delete status flag should be restored. If it is not set to false,`checkOpen` will throw `FileInfoDeletedException` when judging the fence status of `ledgerHandle` when adding an entry, causing the writing to fail. When the client changes the `ensemble`, it throws an exception because the test has only two bookie nodes and cannot satisfy the two writeSet: `Not enough non-faulty bookies available`. ```java public synchronized boolean isFenced() throws IOException { checkOpen(false); return (stateBits & STATE_FENCED_BIT) == STATE_FENCED_BIT; } private synchronized void checkOpen(boolean create, boolean openBeforeClose) throws IOException { if (deleted) { throw new FileInfoDeletedException(); } ..... } ``` When `FileInfo` moves to a new directory by `moveToNewLocation`,delete the old index file and restore the `delete` flag, because the new index file is ready. Set the disk check interval to the `Integer.MAX_VALUE`, which is stable `assertEquals("writable dirs should have one dir", 1, ledgerDirsManager .getWritableLedgerDirs().size());` Because once the test thrashes, the disk check thread will restore the full disk to a writable state. ```java newConf.setDiskCheckInterval(Integer.MAX_VALUE); ``` (cherry picked from commit 1908b7e) (cherry picked from commit da532fc)
Ghatage
pushed a commit
to sijie/bookkeeper
that referenced
this pull request
Jul 12, 2024
…#3421) ### Motivation Fixes issue apache#2665 When the disk is full, `InterleavedLedgerStorage` creates a new entryLog and index file, copies and moves the old index (newFile) `FileInfo` to the new directory, and finally deletes the old index file. The old file of `FileInfo` was `deleted`, but it was copied and moved a newFile to the new directory. Therefore, the delete status flag should be restored. If it is not set to false,`checkOpen` will throw `FileInfoDeletedException` when judging the fence status of `ledgerHandle` when adding an entry, causing the writing to fail. When the client changes the `ensemble`, it throws an exception because the test has only two bookie nodes and cannot satisfy the two writeSet: `Not enough non-faulty bookies available`. ```java public synchronized boolean isFenced() throws IOException { checkOpen(false); return (stateBits & STATE_FENCED_BIT) == STATE_FENCED_BIT; } private synchronized void checkOpen(boolean create, boolean openBeforeClose) throws IOException { if (deleted) { throw new FileInfoDeletedException(); } ..... } ``` ### Changes When `FileInfo` moves to a new directory by `moveToNewLocation`,delete the old index file and restore the `delete` flag, because the new index file is ready. Set the disk check interval to the `Integer.MAX_VALUE`, which is stable `assertEquals("writable dirs should have one dir", 1, ledgerDirsManager .getWritableLedgerDirs().size());` Because once the test thrashes, the disk check thread will restore the full disk to a writable state. ```java newConf.setDiskCheckInterval(Integer.MAX_VALUE); ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Motivation
Fixes issue #2665
When the disk is full,
InterleavedLedgerStorage
creates a new entryLog and index file, copies and moves the old index (newFile)FileInfo
to the new directory, and finally deletes the old index file.The old file of
FileInfo
wasdeleted
, but it was copied and moved a newFile to the new directory. Therefore, the delete status flag should be restored. If it is not set to false,checkOpen
will throwFileInfoDeletedException
when judging the fence status ofledgerHandle
when adding an entry, causing the writing to fail. When the client changes theensemble
, it throws an exception because the test has only two bookie nodes and cannot satisfy the two writeSet:Not enough non-faulty bookies available
.Changes
When
FileInfo
moves to a new directory bymoveToNewLocation
,delete the old index file and restore thedelete
flag, because the new index file is ready.Set the disk check interval to the
Integer.MAX_VALUE
, which is stableassertEquals("writable dirs should have one dir", 1, ledgerDirsManager .getWritableLedgerDirs().size());
Because once the test thrashes, the disk check thread will restore the full disk to a writable state.