Skip to content

Commit

Permalink
do not error out pending adds
Browse files Browse the repository at this point in the history
  • Loading branch information
eolivelli committed Jun 15, 2018
1 parent c24872c commit dd9bdf0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
Expand Up @@ -116,9 +116,6 @@ public void forceLedgerComplete(int rc, long ledgerId, BookieSocketAddress addr,
LOG.info("ForceLedger did not succeed: Ledger {} on {}", ledgerId, addr);
errored = true;

// fail all pending writes
lh.errorOutPendingAdds(rc);

// notify the failure
FutureUtils.completeExceptionally(cb, BKException.create(lastSeenError));
}
Expand Down
Expand Up @@ -110,39 +110,6 @@ public void testForceOnWriteAdvHandle() throws Exception {
}
}

@Test
public void testForceFailPendingAdds() throws Exception {
try (WriteAdvHandle wh = result(newCreateLedgerOp()
.withEnsembleSize(3)
.withWriteQuorumSize(3)
.withAckQuorumSize(2)
.withPassword(PASSWORD)
.withWriteFlags(WriteFlag.DEFERRED_SYNC)
.makeAdv()
.execute())) {
CompletableFuture<Long> w0 = wh.writeAsync(0, DATA);
CompletableFuture<Long> pendingWrite = wh.writeAsync(2, DATA);
result(w0);

BookieSocketAddress bookieAddress = wh.getLedgerMetadata().getEnsembleAt(0).get(0);
killBookie(bookieAddress);

try {
// force will fail
result(wh.force());
fail();
} catch (BKException.BKBookieException err){
}

// all pending writes should fail immediately
try {
result(pendingWrite);
} catch (BKException.BKWriteException err){
}

}
}

@Test
public void testForceRequiresFullEnsemble() throws Exception {
try (WriteHandle wh = result(newCreateLedgerOp()
Expand Down

0 comments on commit dd9bdf0

Please sign in to comment.