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
etcdserver: fix nil pointer panic for readonly txn #14895
Conversation
The old behavior of etcd was it always panic when the application process fails. But we changed the behavior for readonly txn in #14149. Readonly txn doesn't panic any more, but it causes this issue. I am thinking probably we should rollback the change in #14149, so as to keep the original behavior. In short, we should intentionally panic/crash etcd if the application fails, no matter it's readonly or not. More simpler, more stable. WDYT? @ptabor @serathius @spzala |
48d6322
to
a1110c3
Compare
Codecov Report
@@ Coverage Diff @@
## main #14895 +/- ##
==========================================
+ Coverage 74.52% 74.60% +0.07%
==========================================
Files 415 415
Lines 34335 34331 -4
==========================================
+ Hits 25589 25611 +22
+ Misses 7104 7078 -26
Partials 1642 1642
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
For ref,
This comment wasn't fully implemented. All potential errors in txn are from kv layer. For example ErrFutureRev, ErrCompacted. None of I think #14149 fixes legit use-case (see PR description). Context checking in range requests was added long after original |
6c28b75
to
ec3ec0c
Compare
FYI. etcd-io#14891 (comment) Signed-off-by: Benjamin Wang <wachao@vmware.com>
ec3ec0c
to
daad3a2
Compare
This isn't correct. Added an unit test case. PTAL @ptabor @serathius @spzala |
I didn't explain well. The idea is to return partial result and not fail on cancel/timeout when inside txn. It's not the best solution, because user expects full result. But I think it's better than |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for fixing the panic. Don't have enough context about reverting the PR.
Backporting etcd-io#14895 Signed-off-by: Benjamin Wang <wachao@vmware.com>
Backporting etcd-io#14895 Signed-off-by: Benjamin Wang <wachao@vmware.com>
Backporting etcd-io#14895 Signed-off-by: Benjamin Wang <wachao@vmware.com>
Backporting etcd-io#14895 Signed-off-by: Benjamin Wang <wachao@vmware.com>
Backporting etcd-io#14895 Signed-off-by: Benjamin Wang <wachao@vmware.com>
Fix #14891
Please see #14891 (comment)
Signed-off-by: Benjamin Wang wachao@vmware.com
I need to add unit test to verify it.
Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.
cc @ptabor @serathius