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/01/14 06:11:14 UTC

[GitHub] [zookeeper] mayawang edited a comment on issue #984: ZOOKEEPER-3427: Introduce SnapshotComparer that assists debugging with snapshots.

mayawang edited a comment on issue #984: ZOOKEEPER-3427: Introduce SnapshotComparer that assists debugging with snapshots.
URL: https://github.com/apache/zookeeper/pull/984#issuecomment-574014806
 
 
   This new PR version addresses comments and feedbacks in the previous PR version.
   
   ## Change Notes:
   
   1. Made this tool support gz/snappy compressed snapshot formats in addition to uncompressed snapshot format.
   2. Fixed a minor bug in CompareLine(), improved error handling and docs.
   3. Added shell script to make SnapshotComparer tool more user friendly.
   4. Added detailed usage docs in `zookeeperTools.md`.
   
   ## Testing:
   
   ### Style check
   mvn -DskipTests checkstyle:check
   
   ### Local Testing by running shell script and compare different file formats:
   Example results:
   
   `snappy` vs `gz`:
   ```
   # $ bin/zkSnapshotComparer.sh -l /zookeeper-data/backup/snapshot.0.snappy -r /zookeeper-data/backup/snapshot.8.gz -b 100000 -n 100
   ...
   Deserialized snapshot in snapshot.0.snappy in 0.030391 seconds
   Processed data tree in 0.098400 seconds
   2020-01-13 00:37:09,089 [myid:] - INFO  [main:WatchManagerFactory@42] - Using org.apache.zookeeper.server.watch.WatchManager as watch manager
   2020-01-13 00:37:09,089 [myid:] - INFO  [main:WatchManagerFactory@42] - Using org.apache.zookeeper.server.watch.WatchManager as watch manager
   Deserialized snapshot in snapshot.8.gz in 0.000734 seconds
   Processed data tree in 0.000140 seconds
   Node count: 4
   Total size: 0
   Max depth: 3
   Count of nodes at depth 1: 1
   Count of nodes at depth 2: 1
   Count of nodes at depth 3: 2
   
   Node count: 8
   Total size: 0
   Max depth: 4
   Count of nodes at depth 1: 1
   Count of nodes at depth 2: 2
   Count of nodes at depth 3: 4
   Count of nodes at depth 4: 1
   
   Analysis for depth 0
   Analysis for depth 1
   Analysis for depth 2
   Analysis for depth 3
   All layers compared.
   ```
   
   `snappy` vs `snappy`
   ```
   $ bin/zkSnapshotComparer.sh -l /zookeeper-data/backup/snapshot.0.snappy -r /zookeeper-data/backup/snapshot.d.snappy -b 100000 -n 100
   ...
   Deserialized snapshot in snapshot.d.snappy in 0.000593 seconds
   Processed data tree in 0.000211 seconds
   Node count: 4
   Total size: 0
   Max depth: 3
   Count of nodes at depth 1: 1
   Count of nodes at depth 2: 1
   Count of nodes at depth 3: 2
   
   Node count: 10
   Total size: 0
   Max depth: 4
   Count of nodes at depth 1: 1
   Count of nodes at depth 2: 2
   Count of nodes at depth 3: 4
   Count of nodes at depth 4: 3
   
   Analysis for depth 0
   Analysis for depth 1
   Analysis for depth 2
   Analysis for depth 3
   All layers compared.
   ```
   uncompressed vs `snappy`
   ```
   $ bin/zkSnapshotComparer.sh -l /zookeeper-data/backup/snapshot.0 -r /zookeeper-data/backup/snapshot.d.snappy -b 100000 -n 100
   ...
   Deserialized snapshot in snapshot.0 in 0.003973 seconds
   Processed data tree in 0.077579 seconds
   2020-01-13 00:41:19,566 [myid:] - INFO  [main:WatchManagerFactory@42] - Using org.apache.zookeeper.server.watch.WatchManager as watch manager
   2020-01-13 00:41:19,566 [myid:] - INFO  [main:WatchManagerFactory@42] - Using org.apache.zookeeper.server.watch.WatchManager as watch manager
   Deserialized snapshot in snapshot.d.snappy in 0.032078 seconds
   Processed data tree in 0.000609 seconds
   Node count: 4
   Total size: 0
   Max depth: 3
   Count of nodes at depth 1: 1
   Count of nodes at depth 2: 1
   Count of nodes at depth 3: 2
   
   Node count: 10
   Total size: 0
   Max depth: 4
   Count of nodes at depth 1: 1
   Count of nodes at depth 2: 2
   Count of nodes at depth 3: 4
   Count of nodes at depth 4: 3
   
   Analysis for depth 0
   Analysis for depth 1
   Analysis for depth 2
   Analysis for depth 3
   All layers compared.
   ```

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


With regards,
Apache Git Services