Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stable testBookieContinueWritingIfMultipleLedgersPresent test (apache…
…#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); ```
- Loading branch information