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

Automatic idempotency ids have insufficient entropy #11446

Open
atn34 opened this issue Jun 9, 2024 · 0 comments
Open

Automatic idempotency ids have insufficient entropy #11446

atn34 opened this issue Jun 9, 2024 · 0 comments

Comments

@atn34
Copy link
Collaborator

atn34 commented Jun 9, 2024

The automatically generated ids are 128-bit, but the PRNG's seed is only 32-bits. If clients only commit one transaction per process/network thread, then each transaction's id should be fully determined by the 32-bit seed. According to the birthday problem we only need about 82137 transactions in the unexpired window of idempotency ids until we expect to see a collision.

I haven't tried to reproduce this yet, but I expect an effective mitigation to be setting the hidden idempotency_id option with sufficient entropy prior to setting the automatic_idempotency option.

There may be other places we can run into UID collisions because of 32-bit seeds. I don't know if using 128-bit seeds is sufficient to mitigate all this, but it would definitely be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant