[go: nahoru, domu]

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

Ensure the right leader is picked in watcher results for observe. #18169

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jcferretti
Copy link
Contributor

Fixes #18163

@k8s-ci-robot
Copy link

Hi @jcferretti. Thanks for your PR.

I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ivanvc
Copy link
Member
ivanvc commented Jun 13, 2024

Hi @jcferretti, thanks for your contribution. Could you please sign your commit? So the developer certificate of origin (DCO) check passes, i.e:

git rebase HEAD~1 --signoff
git push --force

Thanks!

Ref: https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#commit-your-change

…aign and observe impls.

Signed-off-by: Cristian Ferretti <jcferretti2020@gmail.com>
@jcferretti
Copy link
Contributor Author

Hi @jcferretti, thanks for your contribution. Could you please sign your commit? So the developer certificate of origin (DCO) check passes, i.e:

git rebase HEAD~1 --signoff
git push --force

Thanks!

Ref: https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#commit-your-change

Done, thank you, sorry about missing that.

@ahrtr
Copy link
Member
ahrtr commented Jun 14, 2024

Please add a test to reproduce the issue which you are trying to fix firstly.

@jcferretti
Copy link
Contributor Author

Please add a test to reproduce the issue which you are trying to fix firstly.

Can you please comment on the issue report regarding the analysis there? Thanks.
#18163

@jcferretti jcferretti changed the title Ensure the right leader is picked in watcher results for campaign and observe impls. Ensure the right leader is picked in watcher results for observe. Jun 14, 2024
Comment on lines -200 to +206
hdr, kv = &wr.Header, ev.Kv
// may have multiple revs; hdr.rev = the last rev
// set to kv's rev in case batch has multiple Puts
hdr.Revision = kv.ModRevision
break
if kv == nil || ev.Kv.CreateRevision < kv.CreateRevision {
hdr, kv = &wr.Header, ev.Kv
// may have multiple revs; hdr.rev = the last rev
// set to kv's rev in case batch has multiple Puts
hdr.Revision = kv.ModRevision
}
Copy link
Member

Choose a reason for hiding this comment

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

I do not see any issue here.

Copy link
Contributor Author
@jcferretti jcferretti Jun 17, 2024

Choose a reason for hiding this comment

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

The issue as I see it is not kv being null. The issue as I see it is the possibility that the watch returns more than one PUT, and the current code ignores any other PUT aside from the first.

Can you please make explicit what specific watch guarantee ensures we can't get more than one PUT?

Please also see #18163 (comment)

Thanks for your time.

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

Successfully merging this pull request may close these issues.

Election.Observe may report the wrong leader
4 participants