Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zk-omni-dump: zk+fle+zab sniffer with automatic port detection #52

Merged
merged 15 commits into from
Jul 16, 2015

Conversation

AkihiroSuda
Copy link
Contributor

zk-omni-dump: zk+fle+zab sniffer with automatic port detection

this is useful for JUnit testcases where ports are randomly assigned.

example usage:

 $ sudo zk-omni-dump
 $ cd ~/zookeeper
 $ ant -Dtestcase=ReconfigRecoveryTest -Dtest.method=testCurrentObserverIsParticipantInNewConfig test-core-java

for further information, please refer to zk-omni-dump --help and test_omni.py.

port detection:

First of all, zk-omni-dump tries to detect FLE.Initial. This detection is easy because structure of FLE.Initial is very simple.

Then zk-omni-dump learns FLE port and tries to detect FLE.Notification.

After zk-omni-dump detected FLE.Notification, it parses quorum config string in the FLE.Notification packet and learn all the ports.

TODO:

  • ignore four-letter packets

…tring

these bytes were unexpectedly prepended to config string
 - int32 Notification.CURRENTVERSION
 - int32 configData.length
…tring

these bytes were unexpectedly prepended to config string
 - int32 Notification.CURRENTVERSION
 - int32 configData.length
…is useful for JUnit testcases where ports are randomly assigned.

usage:
 $ zk-omni-dump
 $ ant -Dtestcase=ReconfigRecoveryTest -D test.method=testCurrentObserverIsParticipantInNewConfig test-core-java

port detection:
 First of all, zk-omni-dump tries to detect FLE.Initial. This detection is easy because structure of FLE.Initial is very simple.
 Then zk-omni-dump learns FLE port and tries to detect FLE.Notification.
 After zk-omni-dump detected FLE.Notification, it parses quorum config string and learn all the ports.

TODO:
 ignore four-letter packets
@rgs1
Copy link
Collaborator

rgs1 commented Jul 15, 2015

Thanks for the pull request @AkihiroSuda ! This generally looks great, only one small nit in AkihiroSuda@fb07a1d with regards to using ABCMeta as a parent of base class (so @AbstractMethod can be enforced).

Other than that, it's good to be merged. Thanks!

@AkihiroSuda
Copy link
Contributor Author

@rgs1
Thank you a lot for reviewing!
I added some commits to follow your comments.

I use six metaclass for future py3k support.

rgs1 added a commit that referenced this pull request Jul 16, 2015
zk-omni-dump: zk+fle+zab sniffer with automatic port detection
@rgs1 rgs1 merged commit 9b0a3f0 into twitter:master Jul 16, 2015
@rgs1
Copy link
Collaborator

rgs1 commented Jul 16, 2015

Merged, thanks @AkihiroSuda !

@AkihiroSuda
Copy link
Contributor Author

@rgs1
Thank you for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants