Skip to content

ZooKeeper proxy filter#5991

Merged
snowp merged 121 commits intoenvoyproxy:masterfrom
rgs1:add-zookeeper-filter
Mar 25, 2019
Merged

ZooKeeper proxy filter#5991
snowp merged 121 commits intoenvoyproxy:masterfrom
rgs1:add-zookeeper-filter

Conversation

@rgs1
Copy link
Copy Markdown
Member

@rgs1 rgs1 commented Feb 18, 2019

This filter decodes the ZooKeeper wire protocol and emits
stats & metadata about requests. Responses and events
will be supported in a follow-up PR.

This wire protocol parsing is based on:

https://github.com/twitter/zktraffic
https://github.com/rgs1/zktraffic-cpp

The actual filter structure is based on the Mysql proxy filter.

Signed-off-by: Raul Gutierrez Segales [email protected]

This filter decodes the ZooKeeper wire protocol and emits
stats & metadata about requests, responses and events.

This wire protocol parsing is based on:

https://github.com/twitter/zktraffic
https://github.com/rgs1/zktraffic-cpp

The actual filter structure is based on the Mysql proxy filter.

Signed-off-by: Raul Gutierrez Segales <[email protected]>
@rgs1
Copy link
Copy Markdown
Member Author

rgs1 commented Feb 18, 2019

Note: this is not finished yet, but early comments are welcomed :-)

Raul Gutierrez Segales added 3 commits February 17, 2019 20:53
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Copy link
Copy Markdown
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left you a few comments to get you started.

Has the maintainer sponsorship story for this extension been figured out as per https://docs.google.com/document/d/1eDQQSxqx2khTXfa2vVm4vqkyRwXYkPzZCcbjxJ2_AvA/edit ?

@rgs1
Copy link
Copy Markdown
Member Author

rgs1 commented Feb 18, 2019

@snowp thanks for the comments! I'll address them right away.

Whereas wrt to a senior maintaner sponsoring this, I was thinking maybe @mattklein123 or @zuercher :-)

Signed-off-by: Raul Gutierrez Segales <[email protected]>
@rgs1
Copy link
Copy Markdown
Member Author

rgs1 commented Feb 19, 2019

Left you a few comments to get you started.

Has the maintainer sponsorship story for this extension been figured out as per https://docs.google.com/document/d/1eDQQSxqx2khTXfa2vVm4vqkyRwXYkPzZCcbjxJ2_AvA/edit ?

Oops, my bad — I am somehow misread that I needed a senior maintainer...

@snowp if you have some cycles for sponsoring, that would be great :-)

Raul Gutierrez Segales added 5 commits February 19, 2019 21:30
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Raul Gutierrez Segales added 12 commits February 22, 2019 12:19
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Also, rename the Opcodes enum for consistency.

Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Raul Gutierrez Segales added 2 commits March 19, 2019 09:41
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Copy link
Copy Markdown
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missing some coverage on the create flags, otherwise I think this looks good

@rgs1
Copy link
Copy Markdown
Member Author

rgs1 commented Mar 20, 2019

Still missing some coverage on the create flags, otherwise I think this looks good

added.

Raul Gutierrez Segales added 10 commits March 19, 2019 17:25
Signed-off-by: Raul Gutierrez Segales <[email protected]>
This is valid in the client protocol, so lets handle that. Also,
this improves coverage for peekString(), since it tests the
branch for zero-length strings.

Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
* the try/catch block was redundant (happens in the decoder already)
* move clear dynamic metadata into its own method

Signed-off-by: Raul Gutierrez Segales <[email protected]>
Fix
Signed-off-by: Raul Gutierrez Segales <[email protected]>
Copy link
Copy Markdown
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor comments, otherwise LGTM

Signed-off-by: Raul Gutierrez Segales <[email protected]>
snowp
snowp previously approved these changes Mar 23, 2019
Copy link
Copy Markdown
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok this looks good to me as a starting point to iterate on in further PRs.

Any @envoyproxy/senior-maintainers able to take a look at this?

alyssawilk
alyssawilk previously approved these changes Mar 25, 2019
Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"LGTM" for source/common/common/enum_to_int.h pending the one nit :-)

@rgs1 rgs1 dismissed stale reviews from alyssawilk and snowp via 3ec7cb4 March 25, 2019 15:28
Signed-off-by: Raul Gutierrez Segales <[email protected]>
@rgs1
Copy link
Copy Markdown
Member Author

rgs1 commented Mar 25, 2019

/retest

@repokitteh-read-only
Copy link
Copy Markdown

🙀 failed invoking rebuild of ci/circleci: mac: 500 Internal Server Error

🐱

Caused by: a #5991 (comment) was created by @rgs1.

see: more, trace.

@snowp snowp merged commit b771f99 into envoyproxy:master Mar 25, 2019
@alxn
Copy link
Copy Markdown

alxn commented Sep 1, 2020

@rgs1 I have a question about this work. The two references are pcap interceptors, this change is an L7 proxy for zookeeper traffic?

@rgs1
Copy link
Copy Markdown
Member Author

rgs1 commented Sep 1, 2020

@rgs1 I have a question about this work. The two references are pcap interceptors, this change is an L7 proxy for zookeeper traffic?

Correct -- it's L7 but it's also passive. It understands the ZK protocol, but just to emit stats and generate logging. It won't create its own clients or keep sessions on behalf of clients.

@alxn
Copy link
Copy Markdown

alxn commented Sep 1, 2020

@rgs1 but in order to use this filter, you now have:

client <-first-tcp-session-> envoy <-second-tcp-session-> Zookeeper

@rgs1
Copy link
Copy Markdown
Member Author

rgs1 commented Sep 1, 2020

@rgs1 but in order to use this filter, you now have:

client <-first-tcp-session-> envoy <-second-tcp-session-> Zookeeper

True. That would be true as well if you were using a network load balancer of any sort (e.g.: an NLB in Amazon).

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.

6 participants