Skip to content
This repository was archived by the owner on Oct 7, 2023. It is now read-only.

Issue98fix#102

Open
hokie228 wants to merge 8 commits into
etcd-io:masterfrom
TrustedKeep:issue98fix
Open

Issue98fix#102
hokie228 wants to merge 8 commits into
etcd-io:masterfrom
TrustedKeep:issue98fix

Conversation

@hokie228

Copy link
Copy Markdown

This fixes the encoding of a partial response to a multi-op request where one succeeds but another fails. The current implementation returns an error with no response, but Kafka expects Zookeeper to still respond with two results, one with a type of opCheck and another with type opError.

This patch allows it to response to each part of a multi-op request individually, using the first error in the list as the overall result. This fixes the NPE in Kafka described in Issue #98

zkResponse was hiding multi-op error in partial response,
added new response with error function.  Also, fixed test
to expect correct errors instead of api errors

Fixes etcd-io#98
The current multiop implementation was not properly encoding a single error
in a multiop request.  If op 1 succeeds, but op 2 fails, then zookeeper
should return two responses, one success and one failure of type -1.

Fixes etcd-io#98
@heyitsanthony

heyitsanthony commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

Changes look OK; have you tried the cross-checked integration tests with go test -tags xchk,docker?

Comment thread zketcd.go Outdated
bs[i] = z.mkSetDataTxnOp(req)
mresp.Ops[i].Header.Type = opSetData
case *CheckVersionRequest:
mresp.Ops[i].Header.Type = opCheck

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

move this after mkCheckVersionPathTxnOp to be consistent with the other cases?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Suggested change has been made.

I have not been able to get the xchk,docker tests to run yet, they just seem to hang. I can't get them to run for the master branch either.

Do you have any instructions on setting that up?

moved mkCheckVersionPathTxnOp up 1 line to be consistent with other cases

Fixes etcd-io#98
The xchk with docker integration tests are broken.  The docker files were
attempting to download old versions of Kafka and drill that no longer
existed on the servers.  In addition the RUOK test was causing all tests
to hang in the docker mode by causing a NPE Zookeeper and never
completely starting up.
Existing Multi() integration test just had panic(wut).  Implemented the integration test
and fixed one issue identified by it.  The multi-op case was returning a different xid
than zookeeper when an empty list was passed in to a multi-op
Kafka test was failing due to wrong ports and non-executable run file
@hokie228

hokie228 commented Mar 1, 2019

Copy link
Copy Markdown
Author

I have also fixed the integration cross-check tests and implemented the Multi-op test. There are still some failures in the integration tests unrelated to the Multi-op changes than I will try to address later, but all the unit and integration tests pass now. I think everything is ready to go.

kshvakov added a commit to kshvakov/zetcd that referenced this pull request Mar 15, 2019
@F21

F21 commented Apr 10, 2019

Copy link
Copy Markdown

Any chance this can be merged soon?

@mickymiek

Copy link
Copy Markdown

@heyitsanthony ?

@arizvisa

arizvisa commented Sep 4, 2020

Copy link
Copy Markdown

@xiang90, can you look at merging this? It seems to have been silently dropped by the original maintainer...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants