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

iterate returns duplicate keys #299

Closed
NorseGaud opened this issue Nov 2, 2021 · 3 comments
Closed

iterate returns duplicate keys #299

NorseGaud opened this issue Nov 2, 2021 · 3 comments

Comments

@NorseGaud
Copy link

NorseGaud commented Nov 2, 2021

Original issue: boltdb/bolt#632 by @xiang90


I expect iterating a bucket with cursor return keys in order, but it would return duplicated keys.

Here is the data

And here is the script to reproduce the problem

Here is the output:

key="\x00\x00\x00\x00\x00\x00\xfe\x9d_\x00\x00\x00\x00\x00\x00\x00\x00"
key="\x00\x00\x00\x00\x00\x00\xfe\x9c_\x00\x00\x00\x00\x00\x00\x00\x00"
key="\x00\x00\x00\x00\x00\x00\xfe\x9b_\x00\x00\x00\x00\x00\x00\x00\x00"
key="\x00\x00\x00\x00\x00\x00\xfe\x9a_\x00\x00\x00\x00\x00\x00\x00\x00"
duplicated key="\x00\x00\x00\x00\x00\x00\xfe\x9c_\x00\x00\x00\x00\x00\x00\x00\x00"!!!!
duplicated key="\x00\x00\x00\x00\x00\x00\xfe\x9b_\x00\x00\x00\x00\x00\x00\x00\x00"!!!!
duplicated key="\x00\x00\x00\x00\x00\x00\xfe\x9a_\x00\x00\x00\x00\x00\x00\x00\x00"!!!!

Am I missing something?

The key \x00\x00\x00\x00\x00\x00\xfe\x9c_\x00\x00\x00\x00\x00\x00\x00\x00 shows up twice during cursor iterating.

There are examples and much more in boltdb/bolt#632 -- please go there and take a look

@ahrtr
Copy link
Member

ahrtr commented Nov 7, 2021

I couldn't reproduce this issue using bbolt 1.3.6 on db files generated on both etcd 3.4.13 and 3.5.0.

If you see this issue, please provide the db file and let me know the etcd version.

@NorseGaud
Copy link
Author

NorseGaud commented Nov 7, 2021

@ahrtr , all information is in etcd-io/etcd#13456 and etcd-io/etcd#7011

@ptabor
Copy link
Contributor

ptabor commented Dec 30, 2022

All I can recommend is to follow similar investigation to:
#335

@ptabor ptabor closed this as completed Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants