-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Refactor common revision code to pkg #16269
Conversation
b230d3b
to
fadbbbb
Compare
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.
The changes look good.
It might help to #15979.
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.
This refactor incorrectly mixes revision as a transaction identifier and revision serialization used for mvcc. In the first case the revision has 17 bytes in second has 18 bytes as it includes tombstone.
The original code is no better, but at least it's private and separated, so changes in logic will not break etcdserver.
I would propose to do the refactoring in different order. Proposed steps:
|
|
We don't The The Implicit Kubernetes-ETCD Contract is totally unrelated. Please understand that revision as a concept for versioning changes is separate from how etcd stores revision on disk. Method |
It partially makes sense to me. The revision storage format is just etcd's internal mechanism, and users do not care about it. So from this perspective, it doesn't make sense to expose them. But it's a common mechanism inside etcd, so a modification based on my above comment #16269 (comment) is to get them included in |
Right, I'm not against exposing the etcd storage mechanism. I'm postulating code should:
|
Agreed. |
Based on above discussion, the actions:
|
Good point ! |
@serathius just so I make sure I'm understanding you properly. Are you suggesting to have both mvcc.RevisionTombstone (for internal storage usage in mvcc) and revision.Revision for external usage in things like etcdutl? |
Yes, etcdutl reads data stored in |
fadbbbb
to
7b663f1
Compare
c0f09b3
to
bb765fd
Compare
Please note that mvcc is the package where Possibly it would be more reasonable to split this PR into two, first one introduces |
bb765fd
to
620bf51
Compare
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.
cc @ahrtr
620bf51
to
fe3535b
Compare
I understand that the But I find it's confusing when reviewing the PR, and sometimes there is no clear boundary when to use which one ( Actually the markTombstone is only used in a couple of places, and appendMarkTombstone is only used in So I suggest to remove |
fe3535b
to
5691307
Compare
Signed-off-by: Allen Ray <[email protected]>
5691307
to
395376d
Compare
Thanks @dusk125 for the quick update. Now the Overall looks good to me. Leave to @serathius to take another look. |
Addresses #16159.
Moves the revision structure definition and related functions from package mvcc in the server, to a subpackage in pkg.