You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "eolivelli (via GitHub)" <gi...@apache.org> on 2023/04/13 12:01:53 UTC

[GitHub] [bookkeeper] eolivelli commented on a diff in pull request #3917: Fix ledger replicated failed blocks bookie decommission process

eolivelli commented on code in PR #3917:
URL: https://github.com/apache/bookkeeper/pull/3917#discussion_r1165418967


##########
bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookieWriteLedgerTest.java:
##########
@@ -1454,6 +1467,67 @@ public void testLedgerCreateByteBufRefCnt() throws Exception {
         bkc.deleteLedger(lh.ledgerId);
     }
 
+    @Test
+    public void testReadLacNotSameWithMetadata() throws Exception {
+       lh = bkc.createLedger(3, 3, 2, digestType, ledgerPassword);
+        for (int i = 0; i < 10; ++i) {
+            ByteBuffer entry = ByteBuffer.allocate(4);
+            entry.putInt(rng.nextInt(maxInt));
+            entry.position(0);
+            lh.addEntry(entry.array());
+        }
+
+        List<BookieId> ensemble = lh.getLedgerMetadata().getAllEnsembles().entrySet().iterator().next().getValue();
+        assertEquals(1, lh.getLedgerMetadata().getAllEnsembles().size());
+        killBookie(ensemble.get(1));
+
+
+        try {
+            lh.ensembleChangeLoop(ensemble, Collections.singletonMap(1, ensemble.get(1)));
+        } catch (Exception e) {

Review Comment:
   Of we expect an exception we should add a fail() statement inside the try block.
   Maybe we could also perform some assertion over this Exception (optionally)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org