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

mvcc:add ut for Revisions/CountRevisions and remove RangeSince as it … #14124

Merged
merged 1 commit into from
Jun 21, 2022
Merged

mvcc:add ut for Revisions/CountRevisions and remove RangeSince as it … #14124

merged 1 commit into from
Jun 21, 2022

Conversation

wayblink
Copy link

…is not used

Signed-off-by: wayblink wayasxxx@gmail.com

@@ -107,6 +105,9 @@ func (ti *treeIndex) unsafeVisit(key, end []byte, f func(ki *keyIndex) bool) {
})
}

// Revisions returns limited number of revisions from key(including) to end(excluding)
// at the given rev. The returned slice is sorted in the order of key.
// There is no limit if limit <= 0.
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems also important that 'total' is not capped by the limit and reflects all the revisions.

Copy link
Member

Choose a reason for hiding this comment

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

Comments:

  1. including to included, and excluding to excluded? This applies to the comment for method CountRevisions as well.
  2. adding comment something like "The second return parameter total isn't capped by the limit, and reflects all the expected revisions".

I'd defer to @spzala to correct the syntax of the comment.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for review, update as you commented.

Copy link
Contributor

@ptabor ptabor left a comment

Choose a reason for hiding this comment

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

Thank you for the improvements and expanding the tests.

@ahrtr
Copy link
Member

ahrtr commented Jun 17, 2022

Overall looks good to me. Thank you.

Leave @spzala to final decision.

@ptabor ptabor requested a review from spzala June 17, 2022 18:26
@@ -107,6 +105,9 @@ func (ti *treeIndex) unsafeVisit(key, end []byte, f func(ki *keyIndex) bool) {
})
}

// Revisions returns limited number of revisions from key(included) to end(excluded)
// at the given rev. The returned slice is sorted in the order of key. There is no limit if limit <= 0.
// The second return parameter total isn't capped by the limit, and reflects all the expected revisions.
Copy link
Member

Choose a reason for hiding this comment

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

Minor comment: replace total with total.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, minor but it would be good to make change considering how the parameter name. May be it will be more consistent with readability by changing the sentence to The second return parameter isn't capped by the limit and reflects the total number of revisions. Also, this way no need to markdown any variable?. cc @ahrtr

Copy link
Member

Choose a reason for hiding this comment

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

@wayblink Please update per the comment. Either replace total with total, or just remove the parameter name per @spzala 's comment.

I will merge this PR once it's updated and pipeline is green.

Copy link
Author

Choose a reason for hiding this comment

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

Updated. Thanks a lot

@spzala
Copy link
Member

spzala commented Jun 20, 2022

Overall looks good to me. Thank you.

Leave @spzala to final decision.

Thanks @ahrtr Looking right now.

Copy link
Member

@spzala spzala left a comment

Choose a reason for hiding this comment

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

One comment in-line but otherwise looks good. Thanks @wayblink

@@ -107,6 +105,9 @@ func (ti *treeIndex) unsafeVisit(key, end []byte, f func(ki *keyIndex) bool) {
})
}

// Revisions returns limited number of revisions from key(included) to end(excluded)
// at the given rev. The returned slice is sorted in the order of key. There is no limit if limit <= 0.
// The second return parameter total isn't capped by the limit, and reflects all the expected revisions.
Copy link
Member

Choose a reason for hiding this comment

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

Yes, minor but it would be good to make change considering how the parameter name. May be it will be more consistent with readability by changing the sentence to The second return parameter isn't capped by the limit and reflects the total number of revisions. Also, this way no need to markdown any variable?. cc @ahrtr

…is not used

Signed-off-by: wayblink <wayasxxx@gmail.com>
@ahrtr ahrtr merged commit e0998f4 into etcd-io:main Jun 21, 2022
fuweid added a commit to fuweid/etcd that referenced this pull request Jan 16, 2023
It is kind of backport from etcd-io#14124.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
fuweid added a commit to fuweid/etcd that referenced this pull request Jan 18, 2023
It is kind of backport from etcd-io#14124.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants