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

improve in order key generation #3275

Merged
merged 1 commit into from
Aug 13, 2015
Merged

improve in order key generation #3275

merged 1 commit into from
Aug 13, 2015

Conversation

xiang90
Copy link
Contributor

@xiang90 xiang90 commented Aug 12, 2015

Generating in order key that padding with 0 as its prefix.

It would be help to sort them lexicographically.

@xiang90 xiang90 force-pushed the sort branch 2 times, most recently from 2bc4854 to 32086e6 Compare August 12, 2015 20:26
@xiang90
Copy link
Contributor Author

xiang90 commented Aug 12, 2015

Note this breaks the API and previous behavior. I think it might be OK, since people should not rely on the naming (if they do, they already have done it wrong... they have to compare the created index to sort anyway)

@@ -423,13 +423,13 @@ curl -s 'http://127.0.0.1:2379/v2/keys/queue?recursive=true&sorted=true'
"nodes": [
{
"createdIndex": 2,
"key": "/queue/2",
"key": "/queue/00000000000000000002",
Copy link
Contributor

Choose a reason for hiding this comment

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

i think we need to update the key field in create response too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch. i will change.

@yichengq
Copy link
Contributor

I agree that this change still provides the original guarantee.

@xiang90
Copy link
Contributor Author

xiang90 commented Aug 13, 2015

@yichengq Updated. PTAL.

@yichengq
Copy link
Contributor

lgtm

xiang90 added a commit that referenced this pull request Aug 13, 2015
improve in order key generation
@xiang90 xiang90 merged commit 959feb7 into etcd-io:master Aug 13, 2015
@xiang90 xiang90 deleted the sort branch August 13, 2015 20:51
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.

None yet

2 participants