-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: Shard MeasurementsByContinuationToken index to avoid hotspotting #1852
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @SanjayVas)
src/main/resources/kingdom/spanner/shard-measurements-by-continuation-token.sql
line 36 at r1 (raw file):
); RUN BATCH;
nit: empty line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @SanjayVas)
src/main/resources/kingdom/spanner/shard-measurements-by-continuation-token.sql
line 27 at r1 (raw file):
) STORED; DROP INDEX MeasurementsByContinuationToken;
This is not going to roll out well.
898032f
to
5bfb5b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @kungfucraig and @renjiezh)
src/main/resources/kingdom/spanner/shard-measurements-by-continuation-token.sql
line 27 at r1 (raw file):
Previously, kungfucraig (Craig Wright) wrote…
This is not going to roll out well.
True, there will be a period of time where there is no index. I thought this was acceptable in the current state of the application.
- We need the original index to be dropped to avoid the write hotspotting
- There's no way to rename an index, only drop and recreate. To get zero downtime without an index and get the original index name, it would mean two backfills.
5bfb5b1
to
31b8d1e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 3 files reviewed, all discussions resolved (waiting on @renjiezh)
src/main/resources/kingdom/spanner/shard-measurements-by-continuation-token.sql
line 27 at r1 (raw file):
Previously, SanjayVas (Sanjay Vasandani) wrote…
True, there will be a period of time where there is no index. I thought this was acceptable in the current state of the application.
- We need the original index to be dropped to avoid the write hotspotting
- There's no way to rename an index, only drop and recreate. To get zero downtime without an index and get the original index name, it would mean two backfills.
In a perfect world this change would be rolled out across three pushes, but that's not the world we live in.
So let's just flag this in the release notes.
31b8d1e
to
d940464
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 3 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @renjiezh)
From the [Cloud Spanner documentation on secondary indexes](https://cloud.google.com/spanner/docs/secondary-indexes): > Be aware that using the commit timestamp column as the first part of the secondary index can create hotspots and reduce write performance. Sharding is one of the recommendations given for how to avoid hotspotting.
d940464
to
26384e8
Compare
From the Cloud Spanner documentation on secondary indexes:
Sharding is one of the recommendations given for how to avoid hotspotting.