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

Versioned namespaces #332

Merged
merged 9 commits into from Dec 10, 2021
Merged

Versioned namespaces #332

merged 9 commits into from Dec 10, 2021

Conversation

jakedt
Copy link
Member

@jakedt jakedt commented Dec 9, 2021

This PR adjusts all namespace operations to work at a provided revision in order to guarantee request consistency in the face of namespaces changes.

@jakedt jakedt requested a review from ecordell December 9, 2021 22:05
@jakedt jakedt marked this pull request as draft December 9, 2021 22:05
@github-actions github-actions bot added area/api v0 Affects the v0 API area/api v1 Affects the v1 API area/CLI Affects the command line area/dashboard Affects the dashboard area/datastore Affects the storage system area/dispatch Affects dispatching of requests area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Dec 9, 2021
@jakedt jakedt marked this pull request as ready for review December 10, 2021 15:21
@jakedt
Copy link
Member Author

jakedt commented Dec 10, 2021

Note: this make may performance somewhat less predictable, but fixes a real issue with the rollout of new schemas. Now the schema version that was in place as of the chose query revision will be the one that is used to calculate the answer uniformly across all nodes.

ecordell
ecordell previously approved these changes Dec 10, 2021
Copy link
Contributor

@ecordell ecordell left a comment

Choose a reason for hiding this comment

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

LGTM

func filterToLiveObjects(revision datastore.Revision) memdb.FilterFunc {
return func(hasLifetimeRaw interface{}) bool {
obj := hasLifetimeRaw.(hasLifetime)
return uint64(revision.IntPart()) < obj.getCreatedTxn() || uint64(revision.IntPart()) >= obj.getDeletedTxn()
Copy link
Member

Choose a reason for hiding this comment

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

Mind adding a comment here that the filter is inverted?

Copy link
Member

@josephschorr josephschorr left a comment

Choose a reason for hiding this comment

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

LGTM

@jakedt jakedt merged commit 1369fed into main Dec 10, 2021
@jakedt jakedt deleted the versioned-namespaces branch December 10, 2021 21:47
@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/api v0 Affects the v0 API area/api v1 Affects the v1 API area/CLI Affects the command line area/dashboard Affects the dashboard area/datastore Affects the storage system area/dispatch Affects dispatching of requests area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants