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

Remove context from mvcc public interface #18678

Closed
wants to merge 1 commit into from

Conversation

serathius
Copy link
Member

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: serathius

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -304,72 +296,6 @@ func setup(t *testing.T, setup testSetup) (mvcc.KV, lease.Lessor) {
return s, lessor
}

func TestReadonlyTxnError(t *testing.T) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Need to double check the original motivation for the test and if we need to rewrite it. Marking the PR as draft until then.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I think that enough context removal. Based on #14149 this Test validates that Readonly TXN pass context and don't panic on it. This is the exact place where we want to allow canceling Read transactions as it's safe and a feature to allow clients abort requests.

At some point would be good to design how context should be handled in etcd codebase. Non-cancel-able metadata for apply loop that executes writes, that can also be cancel-able for Read request. Both paths meet in the transaction code layer. Would be nice to be able to statically validate at compilation time whether transaction is read only.

cc @ahrtr @shyamjvs

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.75%. Comparing base (7b429f9) to head (a50a734).

Current head a50a734 differs from pull request most recent head 4f38f15

Please upload reports for the commit 4f38f15 to get more accurate results.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
Files with missing lines Coverage Δ
server/etcdserver/apply/apply.go 78.02% <100.00%> (ø)
server/etcdserver/txn/txn.go 91.46% <100.00%> (-1.70%) ⬇️
server/etcdserver/v3_server.go 73.56% <100.00%> (+0.16%) ⬆️

... and 17 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #18678      +/-   ##
==========================================
- Coverage   68.80%   68.75%   -0.06%     
==========================================
  Files         420      420              
  Lines       35540    35544       +4     
==========================================
- Hits        24455    24437      -18     
- Misses       9666     9681      +15     
- Partials     1419     1426       +7     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b429f9...4f38f15. Read the comment docs.

@serathius serathius closed this Oct 5, 2024
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.

3 participants