You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2020/11/15 03:27:54 UTC

[GitHub] [zookeeper] muse-dev[bot] commented on a change in pull request #1491: ZOOKEEPER-3964: Introduce RocksDB snap and implement change data capture to enable incremental snapshot

muse-dev[bot] commented on a change in pull request #1491:
URL: https://github.com/apache/zookeeper/pull/1491#discussion_r523694172



##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/ZKDatabase.java
##########
@@ -628,7 +648,13 @@ public void deserializeSnapshot(InputArchive ia) throws IOException {
      * @throws InterruptedException
      */
     public void serializeSnapshot(OutputArchive oa) throws IOException, InterruptedException {
-        SerializeUtils.serializeSnapshot(getDataTree(), oa, getSessionWithTimeOuts());
+        // Use the methods in FileSnap to serialize the snapshot to an output archive,
+        // we are not writing to a file here.
+        SnapShot snap = new FileSnap(null, oa);
+        snap.serializeSessions(getSessionWithTimeOuts());
+        DataTree dt = getDataTree();
+        snap.serializeACL(dt.getReferenceCountedAclCache());
+        dt.serialize(snap, "tree");

Review comment:
       *RESOURCE_LEAK:*  resource of type `org.apache.zookeeper.server.persistence.FileSnap` acquired by call to `new()` at line 653 is not released after line 657.




----------------------------------------------------------------
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.

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