HBASE-14843 TestWALProcedureStore.testLoad is flakey (addendum)
This commit is contained in:
parent
afc5439be5
commit
0bae444b34
|
@ -111,13 +111,14 @@ public class WALProcedureStore extends ProcedureStoreBase {
|
||||||
private final FileSystem fs;
|
private final FileSystem fs;
|
||||||
private final Path logDir;
|
private final Path logDir;
|
||||||
|
|
||||||
private AtomicBoolean loading = new AtomicBoolean(true);
|
private final AtomicReference<Throwable> syncException = new AtomicReference<Throwable>();
|
||||||
private AtomicBoolean inSync = new AtomicBoolean(false);
|
private final AtomicBoolean loading = new AtomicBoolean(true);
|
||||||
private AtomicReference<Throwable> syncException = new AtomicReference<>();
|
private final AtomicBoolean inSync = new AtomicBoolean(false);
|
||||||
|
private final AtomicLong totalSynced = new AtomicLong(0);
|
||||||
|
private final AtomicLong lastRollTs = new AtomicLong(0);
|
||||||
|
|
||||||
private LinkedTransferQueue<ByteSlot> slotsCache = null;
|
private LinkedTransferQueue<ByteSlot> slotsCache = null;
|
||||||
private Set<ProcedureWALFile> corruptedLogs = null;
|
private Set<ProcedureWALFile> corruptedLogs = null;
|
||||||
private AtomicLong totalSynced = new AtomicLong(0);
|
|
||||||
private AtomicLong lastRollTs = new AtomicLong(0);
|
|
||||||
private FSDataOutputStream stream = null;
|
private FSDataOutputStream stream = null;
|
||||||
private long flushLogId = 0;
|
private long flushLogId = 0;
|
||||||
private int slotIndex = 0;
|
private int slotIndex = 0;
|
||||||
|
@ -148,6 +149,7 @@ public class WALProcedureStore extends ProcedureStoreBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init buffer slots
|
// Init buffer slots
|
||||||
|
loading.set(true);
|
||||||
slots = new ByteSlot[numSlots];
|
slots = new ByteSlot[numSlots];
|
||||||
slotsCache = new LinkedTransferQueue();
|
slotsCache = new LinkedTransferQueue();
|
||||||
while (slotsCache.size() < numSlots) {
|
while (slotsCache.size() < numSlots) {
|
||||||
|
|
|
@ -83,6 +83,7 @@ public class TestWALProcedureStore {
|
||||||
procStore = ProcedureTestingUtility.createWalStore(htu.getConfiguration(), fs, logDir);
|
procStore = ProcedureTestingUtility.createWalStore(htu.getConfiguration(), fs, logDir);
|
||||||
procStore.start(PROCEDURE_STORE_SLOTS);
|
procStore.start(PROCEDURE_STORE_SLOTS);
|
||||||
procStore.recoverLease();
|
procStore.recoverLease();
|
||||||
|
procStore.load(new LoadCounter());
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
|
@ -434,7 +435,9 @@ public class TestWALProcedureStore {
|
||||||
InputStream in = fs.open(logFile.getPath());
|
InputStream in = fs.open(logFile.getPath());
|
||||||
OutputStream out = fs.create(tmpPath);
|
OutputStream out = fs.create(tmpPath);
|
||||||
IOUtils.copyBytes(in, out, logFile.getLen() - dropBytes, true);
|
IOUtils.copyBytes(in, out, logFile.getLen() - dropBytes, true);
|
||||||
fs.rename(tmpPath, logFile.getPath());
|
if (!fs.rename(tmpPath, logFile.getPath())) {
|
||||||
|
throw new IOException("Unable to rename");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void verifyProcIdsOnRestart(final Set<Long> procIds) throws Exception {
|
private void verifyProcIdsOnRestart(final Set<Long> procIds) throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue