You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by yo...@apache.org on 2023/02/21 02:42:07 UTC

[bookkeeper] branch branch-4.15 updated (f3eadd6885 -> d93069d418)

This is an automated email from the ASF dual-hosted git repository.

yong pushed a change to branch branch-4.15
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


    from f3eadd6885 Fix QueueEntry recycle problem. (#3747)
     new 8e2a9e399c Revert "Show content of map (#3538)"
     new 52295f072f Fix the checkstyle issue introduced by cherry-pick
     new e6bd6f2478 Fix cherry-pick issue
     new acfa520ec0 Revert "recycle LongPairWrapper (#3728)"
     new d93069d418 Revert "Speed up the rebuildinding of RocksDB index (#3458)"

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/bookkeeper/bookie/EntryLogMetadata.java |  4 ++--
 .../storage/ldb/LocationsIndexRebuildOp.java       | 25 ++--------------------
 .../bookkeeper/proto/WriteEntryProcessor.java      |  2 --
 .../org/apache/bookkeeper/bookie/EntryLogTest.java |  3 ---
 .../bookie/storage/ldb/WriteCacheTest.java         |  1 -
 5 files changed, 4 insertions(+), 31 deletions(-)


[bookkeeper] 03/05: Fix cherry-pick issue

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.15
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit e6bd6f2478f3f9e07c96c1136cfc8e6f80d72c7e
Author: zymap <zh...@gmail.com>
AuthorDate: Tue Feb 21 09:20:57 2023 +0800

    Fix cherry-pick issue
---
 .../src/main/java/org/apache/bookkeeper/proto/WriteEntryProcessor.java  | 2 --
 1 file changed, 2 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/WriteEntryProcessor.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/WriteEntryProcessor.java
index a0e59be6bf..163b8be0f2 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/WriteEntryProcessor.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/WriteEntryProcessor.java
@@ -102,8 +102,6 @@ class WriteEntryProcessor extends PacketProcessorBase<ParsedAddRequest> implemen
                       request.ledgerId, request.entryId, t.getMessage(), t);
             // some bad request which cause unexpected exception
             rc = BookieProtocol.EBADREQ;
-        } finally {
-            addData.release();
         }
 
         if (rc != BookieProtocol.EOK) {


[bookkeeper] 01/05: Revert "Show content of map (#3538)"

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.15
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 8e2a9e399ccb80cba291d6afcf0efeed041d10e5
Author: zymap <zh...@gmail.com>
AuthorDate: Fri Feb 17 10:32:06 2023 +0800

    Revert "Show content of map (#3538)"
    
    This reverts commit e05f0e0bd548b8302833a905020de1a75958f391.
---
 .../src/main/java/org/apache/bookkeeper/bookie/EntryLogMetadata.java  | 4 ++--
 .../src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java      | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogMetadata.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogMetadata.java
index 44cb708119..0445033b52 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogMetadata.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLogMetadata.java
@@ -107,8 +107,8 @@ public class EntryLogMetadata {
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
-        sb.append("{totalSize = ").append(totalSize).append(", remainingSize = ").append(remainingSize)
-                .append(", ledgersMap = ").append(ledgersMap.toString()).append("}");
+        sb.append("{ totalSize = ").append(totalSize).append(", remainingSize = ").append(remainingSize)
+                .append(", ledgersMap = ").append(ledgersMap).append(" }");
         return sb.toString();
     }
 
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java
index 4971d31f2a..e3627f40ab 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/EntryLogTest.java
@@ -192,9 +192,6 @@ public class EntryLogTest {
         entryLogger = new EntryLogger(conf, dirsMgr);
 
         EntryLogMetadata meta = entryLogger.getEntryLogMetadata(0L);
-        String metaString = meta.toString();
-        assertEquals(metaString,
-                "{totalSize = 60, remainingSize = 60, ledgersMap = ConcurrentLongLongHashMap{1 => 30, 3 => 30}}");
         LOG.info("Extracted Meta From Entry Log {}", meta);
         assertTrue(meta.getLedgersMap().containsKey(1L));
         assertFalse(meta.getLedgersMap().containsKey(2L));


[bookkeeper] 02/05: Fix the checkstyle issue introduced by cherry-pick

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.15
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit 52295f072f99f523041154f6794729d3865a2478
Author: zymap <zh...@gmail.com>
AuthorDate: Fri Feb 17 10:47:33 2023 +0800

    Fix the checkstyle issue introduced by cherry-pick
---
 .../apache/bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java   | 2 +-
 .../java/org/apache/bookkeeper/bookie/storage/ldb/WriteCacheTest.java   | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java
index a3d4df0181..3e84a92438 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java
@@ -105,7 +105,7 @@ public class LocationsIndexRebuildOp {
                     // Update the ledger index page
                     LongPairWrapper key = LongPairWrapper.get(ledgerId, entryId);
                     LongWrapper value = LongWrapper.get(location);
-                    
+
                     try {
                         batch.get().put(key.array, value.array);
                     } finally {
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/storage/ldb/WriteCacheTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/storage/ldb/WriteCacheTest.java
index cd433e8fd2..ac0b63af7f 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/storage/ldb/WriteCacheTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/storage/ldb/WriteCacheTest.java
@@ -30,7 +30,6 @@ import io.netty.buffer.ByteBufAllocator;
 import io.netty.buffer.ByteBufUtil;
 import io.netty.buffer.Unpooled;
 import io.netty.buffer.UnpooledByteBufAllocator;
-import io.netty.util.ReferenceCountUtil;
 import java.io.IOException;
 import java.nio.charset.Charset;
 import java.util.concurrent.BrokenBarrierException;


[bookkeeper] 05/05: Revert "Speed up the rebuildinding of RocksDB index (#3458)"

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.15
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit d93069d4183fb43295c657fb3d74300752b90246
Author: zymap <zh...@gmail.com>
AuthorDate: Tue Feb 21 09:51:45 2023 +0800

    Revert "Speed up the rebuildinding of RocksDB index (#3458)"
    
    This reverts commit a6a407487ae4bd64caf25c06e27cfbe7c64c3f5d.
---
 .../bookie/storage/ldb/LocationsIndexRebuildOp.java   | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java
index e15457ca8e..55c5c90c31 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java
@@ -32,8 +32,7 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
+
 import org.apache.bookkeeper.bookie.BookieImpl;
 import org.apache.bookkeeper.bookie.EntryLogger;
 import org.apache.bookkeeper.bookie.EntryLogger.EntryLogScanner;
@@ -56,8 +55,6 @@ public class LocationsIndexRebuildOp {
         this.conf = conf;
     }
 
-    private static final int BATCH_COMMIT_SIZE = 10_000;
-
     public void initiate() throws IOException {
         LOG.info("Starting locations index rebuilding");
 
@@ -85,8 +82,6 @@ public class LocationsIndexRebuildOp {
         int totalEntryLogs = entryLogs.size();
         int completedEntryLogs = 0;
         LOG.info("Scanning {} entry logs", totalEntryLogs);
-        AtomicReference<KeyValueStorage.Batch> batch = new AtomicReference<>(newIndex.newBatch());
-        AtomicInteger count = new AtomicInteger();
 
         for (long entryLogId : entryLogs) {
             entryLogger.scanEntryLog(entryLogId, new EntryLogScanner() {
@@ -105,15 +100,7 @@ public class LocationsIndexRebuildOp {
                     // Update the ledger index page
                     LongPairWrapper key = LongPairWrapper.get(ledgerId, entryId);
                     LongWrapper value = LongWrapper.get(location);
-                    batch.get().put(key.array, value.array);
-
-                    if (count.incrementAndGet() > BATCH_COMMIT_SIZE) {
-                        batch.get().flush();
-                        batch.get().close();
-
-                        batch.set(newIndex.newBatch());
-                        count.set(0);
-                    }
+                    newIndex.put(key.array, value.array);
                 }
 
                 @Override
@@ -125,8 +112,6 @@ public class LocationsIndexRebuildOp {
             ++completedEntryLogs;
             LOG.info("Completed scanning of log {}.log -- {} / {}", Long.toHexString(entryLogId), completedEntryLogs,
                     totalEntryLogs);
-            batch.get().flush();
-            batch.get().close();
         }
 
         newIndex.sync();


[bookkeeper] 04/05: Revert "recycle LongPairWrapper (#3728)"

Posted by yo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

yong pushed a commit to branch branch-4.15
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git

commit acfa520ec0dfcf076d21e9a2dd7e6cd7b7614d7f
Author: zymap <zh...@gmail.com>
AuthorDate: Tue Feb 21 09:51:27 2023 +0800

    Revert "recycle LongPairWrapper (#3728)"
    
    This reverts commit f92171f10962531103094a84b65da2e57b137475.
---
 .../bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java    | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java
index 3e84a92438..e15457ca8e 100644
--- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java
+++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LocationsIndexRebuildOp.java
@@ -105,13 +105,7 @@ public class LocationsIndexRebuildOp {
                     // Update the ledger index page
                     LongPairWrapper key = LongPairWrapper.get(ledgerId, entryId);
                     LongWrapper value = LongWrapper.get(location);
-
-                    try {
-                        batch.get().put(key.array, value.array);
-                    } finally {
-                        key.recycle();
-                        value.recycle();
-                    }
+                    batch.get().put(key.array, value.array);
 
                     if (count.incrementAndGet() > BATCH_COMMIT_SIZE) {
                         batch.get().flush();