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

fix(upgrade): don't drop shard-group durations when upgrading DBs #22650

Merged
merged 3 commits into from
Oct 11, 2021

Conversation

danxmoran
Copy link
Contributor

Closes #22649

influxd upgrade has been dropping shard-group duration values. Users who upgraded prior to v2.0.5 weren't affected because (as part of enabling updates to shard-group-durations in that version) a KV migration was added to fill in default duration values in the boltDB. Users who upgraded on-or-after v2.0.5 will have been affected, which is likely contributing to the recent reports we've gotten about decreased ingest performance in 2.0.x.

// This is expected to be 0 for all buckets created before
// we began tracking it in metadata.
ShardGroupDuration time.Duration `json:"shardGroupDuration"`
func repairMissingShardGroupDurations(ctx context.Context, store kv.SchemaStore) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The repair logic in the new migration is identical to the logic in the migration I added to initialize shard-group duration values in v2.0.5. I extracted the logic into a function so it could be reused.

Copy link
Contributor

@davidby-influx davidby-influx left a comment

Choose a reason for hiding this comment

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

One typo in a comment, otherwise LGTM

return err
if b.ShardGroupDuration == 0 {
// Backfill the duration using the same method used
// to dervie the value within the storage engine.
Copy link
Contributor

Choose a reason for hiding this comment

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

"derive"

@danxmoran danxmoran merged commit 7b7d4f3 into master Oct 11, 2021
@danxmoran danxmoran deleted the dm-upgrade-persist-shard-group-duration-22649 branch October 11, 2021 21:44
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

Successfully merging this pull request may close these issues.

influxd upgrade drops shard-group duration settings
2 participants