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

v1.WriteSchema relationship sanity check should skip permissions #733

Closed
jzelinskie opened this issue Aug 2, 2022 · 0 comments · Fixed by #734
Closed

v1.WriteSchema relationship sanity check should skip permissions #733

jzelinskie opened this issue Aug 2, 2022 · 0 comments · Fixed by #734
Assignees
Labels
area/api v1 Affects the v1 API area/perf Affects performance or scalability priority/1 high This is the top priority

Comments

@jzelinskie
Copy link
Member

jzelinskie commented Aug 2, 2022

To ensure that data remains valid across schema migrations, v1.WriteSchema performs a sanity check.

An optimization that is missing for this sanity check is to skip permissions as they are computed and cannot contain any data themselves. This optimization would vastly improve the performance of large schema writes on production systems and make schema migrations that only modify permissions nearly instantaneous.

Big thanks to @williamdclt for the report the surfaced this issue.

@jzelinskie jzelinskie added priority/1 high This is the top priority area/perf Affects performance or scalability area/api v1 Affects the v1 API labels Aug 2, 2022
josephschorr added a commit to josephschorr/spicedb that referenced this issue Aug 2, 2022
This PR changes the namespace diff logic to treat relations and permissions distinctly, thus ensuring that WriteSchema will only check for relationships if a *relation* is removed, and not a permission as well. This was a legacy of the time when relations could contain both data and expressions.

Fixes authzed#733
@josephschorr josephschorr self-assigned this Aug 2, 2022
josephschorr added a commit to josephschorr/spicedb that referenced this issue Aug 2, 2022
This PR changes the namespace diff logic to treat relations and permissions distinctly, thus ensuring that WriteSchema will only check for relationships if a *relation* is removed, and not a permission as well. This was a legacy of the time when relations could contain both data and expressions.

Fixes authzed#733
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api v1 Affects the v1 API area/perf Affects performance or scalability priority/1 high This is the top priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants