-
Notifications
You must be signed in to change notification settings - Fork 190
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
Support counters in v7 UUIDs #755
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KodrAus
commented
May 13, 2024
KodrAus
commented
May 13, 2024
I've got a counter implemented, but looks like performance here could use some improvement compared to
|
Ok, I think that's better now:
|
I need to add some tests for the new v7 context, and make sure we're shifting it around the variant field correctly. |
renovate bot
added a commit
to spiraldb/vortex
that referenced
this pull request
Jun 24, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [uuid](https://togithub.com/uuid-rs/uuid) | workspace.dependencies | minor | `1.8.0` -> `1.9.0` | --- ### Release Notes <details> <summary>uuid-rs/uuid (uuid)</summary> ### [`v1.9.0`](https://togithub.com/uuid-rs/uuid/releases/tag/1.9.0) [Compare Source](https://togithub.com/uuid-rs/uuid/compare/1.8.0...1.9.0) #### `Uuid::now_v7()` is guaranteed to be monotonic Before this release, `Uuid::now_v7()` would only use the millisecond-precision timestamp for ordering. It now also uses a global 42-bit counter that's re-initialized each millisecond so that the following will always pass: ```rust let a = Uuid::now_v7(); let b = Uuid::now_v7(); assert!(a < b); ``` #### What's Changed - Add a get_node_id method for v1 and v6 UUIDs by [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#748 - Update atomic and zerocopy to latest by [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#750 - Add repository field to uuid-macro-internal crate by [@​paolobarbolini](https://togithub.com/paolobarbolini) in [uuid-rs/uuid#752 - update docs to updated RFC (from 4122 to 9562) by [@​Mikopet](https://togithub.com/Mikopet) in [uuid-rs/uuid#753 - Support counters in v7 UUIDs by [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#755 #### New Contributors - [@​paolobarbolini](https://togithub.com/paolobarbolini) made their first contribution in [uuid-rs/uuid#752 - [@​Mikopet](https://togithub.com/Mikopet) made their first contribution in [uuid-rs/uuid#753 **Full Changelog**: uuid-rs/uuid@1.8.0...1.9.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/spiraldb/vortex). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTMuMiIsInVwZGF0ZWRJblZlciI6IjM3LjQxMy4yIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
mergify bot
pushed a commit
to andrzejressel/pulumi-wasm
that referenced
this pull request
Jun 24, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [uuid](https://togithub.com/uuid-rs/uuid) | workspace.dependencies | minor | `1.8.0` -> `1.9.0` | --- ### Release Notes <details> <summary>uuid-rs/uuid (uuid)</summary> ### [`v1.9.0`](https://togithub.com/uuid-rs/uuid/releases/tag/1.9.0) [Compare Source](https://togithub.com/uuid-rs/uuid/compare/1.8.0...1.9.0) #### `Uuid::now_v7()` is guaranteed to be monotonic Before this release, `Uuid::now_v7()` would only use the millisecond-precision timestamp for ordering. It now also uses a global 42-bit counter that's re-initialized each millisecond so that the following will always pass: ```rust let a = Uuid::now_v7(); let b = Uuid::now_v7(); assert!(a < b); ``` #### What's Changed - Add a get_node_id method for v1 and v6 UUIDs by [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#748 - Update atomic and zerocopy to latest by [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#750 - Add repository field to uuid-macro-internal crate by [@​paolobarbolini](https://togithub.com/paolobarbolini) in [uuid-rs/uuid#752 - update docs to updated RFC (from 4122 to 9562) by [@​Mikopet](https://togithub.com/Mikopet) in [uuid-rs/uuid#753 - Support counters in v7 UUIDs by [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#755 #### New Contributors - [@​paolobarbolini](https://togithub.com/paolobarbolini) made their first contribution in [uuid-rs/uuid#752 - [@​Mikopet](https://togithub.com/Mikopet) made their first contribution in [uuid-rs/uuid#753 **Full Changelog**: uuid-rs/uuid@1.8.0...1.9.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/andrzejressel/pulumi-wasm).
kodiakhq bot
pushed a commit
to pdylanross/fatigue
that referenced
this pull request
Jun 24, 2024
Bumps uuid from 1.8.0 to 1.9.0. Release notes Sourced from uuid's releases. 1.9.0 Uuid::now_v7() is guaranteed to be monotonic Before this release, Uuid::now_v7() would only use the millisecond-precision timestamp for ordering. It now also uses a global 42-bit counter that's re-initialized each millisecond so that the following will always pass: let a = Uuid::now_v7(); let b = Uuid::now_v7(); assert!(a < b); What's Changed Add a get_node_id method for v1 and v6 UUIDs by @KodrAus in uuid-rs/uuid#748 Update atomic and zerocopy to latest by @KodrAus in uuid-rs/uuid#750 Add repository field to uuid-macro-internal crate by @paolobarbolini in uuid-rs/uuid#752 update docs to updated RFC (from 4122 to 9562) by @Mikopet in uuid-rs/uuid#753 Support counters in v7 UUIDs by @KodrAus in uuid-rs/uuid#755 New Contributors @paolobarbolini made their first contribution in uuid-rs/uuid#752 @Mikopet made their first contribution in uuid-rs/uuid#753 Full Changelog: uuid-rs/uuid@1.8.0...1.9.0 Commits 4a129e7 Merge pull request #760 from uuid-rs/cargo/1.9.0 6bfee6b prepare for 1.9.0 release 62b7145 Merge pull request #759 from uuid-rs/chore/v7-counter-cleanup 62e968c clean up new Timestamp APIs 49319a7 Merge pull request #758 from uuid-rs/chore/test-overflow 47b9130 ensure v7 methods don't overflow on max values 0c561e3 Merge pull request #757 from uuid-rs/ci/more-miri 252770b expand miri tests to cover all features e62647f Merge pull request #755 from uuid-rs/feat/v7-counter c270b3d improve testing for contexts Additional commits viewable in compare view Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase. Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: @dependabot rebase will rebase this PR @dependabot recreate will recreate this PR, overwriting any edits that have been made to it @dependabot merge will merge this PR after your CI passes on it @dependabot squash and merge will squash and merge this PR after your CI passes on it @dependabot cancel merge will cancel a previously requested merge and block automerging @dependabot reopen will reopen this PR if it is closed @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
maxdeviant
pushed a commit
to zed-industries/zed
that referenced
this pull request
Jul 27, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [uuid](https://togithub.com/uuid-rs/uuid) | workspace.dependencies | minor | `1.8.0` -> `1.10.0` | --- ### Release Notes <details> <summary>uuid-rs/uuid (uuid)</summary> ### [`v1.10.0`](https://togithub.com/uuid-rs/uuid/releases/tag/1.10.0) [Compare Source](https://togithub.com/uuid-rs/uuid/compare/1.9.1...1.10.0) #### Deprecations This release deprecates and renames the following functions: - `Builder::from_rfc4122_timestamp` -> `Builder::from_gregorian_timestamp` - `Builder::from_sorted_rfc4122_timestamp` -> `Builder::from_sorted_gregorian_timestamp` - `Timestamp::from_rfc4122` -> `Timestamp::from_gregorian` - `Timestamp::to_rfc4122` -> `Timestamp::to_gregorian` #### What's Changed - Use const identifier in uuid macro by [@​Vrajs16](https://togithub.com/Vrajs16) in [uuid-rs/uuid#764 - Rename most methods referring to RFC4122 by [@​Mikopet](https://togithub.com/Mikopet) / [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#765 - prepare for 1.10.0 release by [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#766 #### New Contributors - [@​Vrajs16](https://togithub.com/Vrajs16) made their first contribution in [uuid-rs/uuid#764 **Full Changelog**: uuid-rs/uuid@1.9.1...1.10.0 ### [`v1.9.1`](https://togithub.com/uuid-rs/uuid/releases/tag/1.9.1) [Compare Source](https://togithub.com/uuid-rs/uuid/compare/1.9.0...1.9.1) #### What's Changed - Add an example of generating bulk v7 UUIDs by [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#761 - Avoid taking the shared lock when getting usable bits in Uuid::now_v7 by [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#762 - Prepare for 1.9.1 release by [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#763 **Full Changelog**: uuid-rs/uuid@1.9.0...1.9.1 ### [`v1.9.0`](https://togithub.com/uuid-rs/uuid/releases/tag/1.9.0) [Compare Source](https://togithub.com/uuid-rs/uuid/compare/1.8.0...1.9.0) #### `Uuid::now_v7()` is guaranteed to be monotonic Before this release, `Uuid::now_v7()` would only use the millisecond-precision timestamp for ordering. It now also uses a global 42-bit counter that's re-initialized each millisecond so that the following will always pass: ```rust let a = Uuid::now_v7(); let b = Uuid::now_v7(); assert!(a < b); ``` #### What's Changed - Add a get_node_id method for v1 and v6 UUIDs by [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#748 - Update atomic and zerocopy to latest by [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#750 - Add repository field to uuid-macro-internal crate by [@​paolobarbolini](https://togithub.com/paolobarbolini) in [uuid-rs/uuid#752 - update docs to updated RFC (from 4122 to 9562) by [@​Mikopet](https://togithub.com/Mikopet) in [uuid-rs/uuid#753 - Support counters in v7 UUIDs by [@​KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#755 #### New Contributors - [@​paolobarbolini](https://togithub.com/paolobarbolini) made their first contribution in [uuid-rs/uuid#752 - [@​Mikopet](https://togithub.com/Mikopet) made their first contribution in [uuid-rs/uuid#753 **Full Changelog**: uuid-rs/uuid@1.8.0...1.9.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone America/New_York, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- Release Notes: - N/A <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
kevmo314
pushed a commit
to kevmo314/zed
that referenced
this pull request
Jul 29, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [uuid](https://togithub.com/uuid-rs/uuid) | workspace.dependencies | minor | `1.8.0` -> `1.10.0` | --- ### Release Notes <details> <summary>uuid-rs/uuid (uuid)</summary> ### [`v1.10.0`](https://togithub.com/uuid-rs/uuid/releases/tag/1.10.0) [Compare Source](https://togithub.com/uuid-rs/uuid/compare/1.9.1...1.10.0) #### Deprecations This release deprecates and renames the following functions: - `Builder::from_rfc4122_timestamp` -> `Builder::from_gregorian_timestamp` - `Builder::from_sorted_rfc4122_timestamp` -> `Builder::from_sorted_gregorian_timestamp` - `Timestamp::from_rfc4122` -> `Timestamp::from_gregorian` - `Timestamp::to_rfc4122` -> `Timestamp::to_gregorian` #### What's Changed - Use const identifier in uuid macro by [@&zed-industries#8203;Vrajs16](https://togithub.com/Vrajs16) in [uuid-rs/uuid#764 - Rename most methods referring to RFC4122 by [@&zed-industries#8203;Mikopet](https://togithub.com/Mikopet) / [@&zed-industries#8203;KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#765 - prepare for 1.10.0 release by [@&zed-industries#8203;KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#766 #### New Contributors - [@&zed-industries#8203;Vrajs16](https://togithub.com/Vrajs16) made their first contribution in [uuid-rs/uuid#764 **Full Changelog**: uuid-rs/uuid@1.9.1...1.10.0 ### [`v1.9.1`](https://togithub.com/uuid-rs/uuid/releases/tag/1.9.1) [Compare Source](https://togithub.com/uuid-rs/uuid/compare/1.9.0...1.9.1) #### What's Changed - Add an example of generating bulk v7 UUIDs by [@&zed-industries#8203;KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#761 - Avoid taking the shared lock when getting usable bits in Uuid::now_v7 by [@&zed-industries#8203;KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#762 - Prepare for 1.9.1 release by [@&zed-industries#8203;KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#763 **Full Changelog**: uuid-rs/uuid@1.9.0...1.9.1 ### [`v1.9.0`](https://togithub.com/uuid-rs/uuid/releases/tag/1.9.0) [Compare Source](https://togithub.com/uuid-rs/uuid/compare/1.8.0...1.9.0) #### `Uuid::now_v7()` is guaranteed to be monotonic Before this release, `Uuid::now_v7()` would only use the millisecond-precision timestamp for ordering. It now also uses a global 42-bit counter that's re-initialized each millisecond so that the following will always pass: ```rust let a = Uuid::now_v7(); let b = Uuid::now_v7(); assert!(a < b); ``` #### What's Changed - Add a get_node_id method for v1 and v6 UUIDs by [@&zed-industries#8203;KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#748 - Update atomic and zerocopy to latest by [@&zed-industries#8203;KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#750 - Add repository field to uuid-macro-internal crate by [@&zed-industries#8203;paolobarbolini](https://togithub.com/paolobarbolini) in [uuid-rs/uuid#752 - update docs to updated RFC (from 4122 to 9562) by [@&zed-industries#8203;Mikopet](https://togithub.com/Mikopet) in [uuid-rs/uuid#753 - Support counters in v7 UUIDs by [@&zed-industries#8203;KodrAus](https://togithub.com/KodrAus) in [uuid-rs/uuid#755 #### New Contributors - [@&zed-industries#8203;paolobarbolini](https://togithub.com/paolobarbolini) made their first contribution in [uuid-rs/uuid#752 - [@&zed-industries#8203;Mikopet](https://togithub.com/Mikopet) made their first contribution in [uuid-rs/uuid#753 **Full Changelog**: uuid-rs/uuid@1.8.0...1.9.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone America/New_York, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- Release Notes: - N/A <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For #717
This PR sketches out a solution to make the v7 support respect the input counter, while retaining existing semantics around filling with random data. It requires a bit of fudgery to keep compatibility with existing APIs, but I think the overall solution works out ok. I need to actually fill it all in fully and then explore ways to better integrate the existing
Timestamp
API, which may involve deprecating bits.The gist of it is to add a
usable_bits
method toClockSequence
, so it can tell how many bits a given counter occupies. The UUID constructor can then do appropriate shifts and fill the rest with random bytes. That way a caller creating a v7 UUID can decide how many bits to dedicate to sequencing and how many to randomness.As part of this PR I'm expecting to find some solution to re-seeding sequences, which will probably remain an implementation detail of the given
ClockSequence
.