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: improved shard deletion #24602

Merged
merged 3 commits into from
Mar 26, 2024
Merged

fix: improved shard deletion #24602

merged 3 commits into from
Mar 26, 2024

Conversation

davidby-influx
Copy link
Contributor

@davidby-influx davidby-influx commented Jan 24, 2024

Avoid unnecessarily deleting series from the series file
Try harder to delete series from InMem indices
Log all errors on shard deletion

Closes #24834

@davidby-influx davidby-influx self-assigned this Jan 24, 2024
@davidby-influx davidby-influx changed the title fix: improved shard deletion fix: improved shard deletion Jan 24, 2024
tsdb/store.go Outdated
Comment on lines 872 to 875
// TODO(DSB): Should we give up on deleting the shard here, to avoid
// removing series from the series file that may exist in the shard
// whose index we could not load?
}
Copy link
Member

Choose a reason for hiding this comment

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

I think the answer is "yes". If we continue deleting, we could lose series. Currently this can only happen during a restore, which probably fixes itself on restore completion, but maybe that changes in the future. Also, if the retention service is running then the shard will eventually be deleted by the retention service, or you will keep getting errors in your log. Since currently the only way to get an error is by running a restore, this will work at some point in the near future.

An alternative is to not remove series if we can't walk all the shards, but then we have phantom series that could impact performance. I prefer we leave the shard on disk until we can properly delete it without losing series or creating a performance issue.

@davidby-influx davidby-influx marked this pull request as ready for review February 6, 2024 15:30
Copy link
Member

@gwossum gwossum left a comment

Choose a reason for hiding this comment

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

LGTM

@davidby-influx davidby-influx merged commit 8ff06d5 into master-1.x Mar 26, 2024
10 checks passed
@davidby-influx davidby-influx deleted the DSB_better_delete branch March 26, 2024 00:15
davidby-influx added a commit that referenced this pull request Mar 26, 2024
Avoid unnecessarily deleting series from the series file
Try harder to delete series from InMem indices
Log all errors on shard deletion

Closes #24834

(cherry picked from commit 8ff06d5)

closes #24836
davidby-influx added a commit that referenced this pull request Mar 26, 2024
Avoid unnecessarily deleting series from the series file
Log all errors on shard deletion

Closes #24834

(cherry picked from commit 8ff06d5)

closes #24836
davidby-influx added a commit that referenced this pull request Mar 27, 2024
Avoid unnecessarily deleting series from the series file
Log all errors on shard deletion

Closes #24834

(cherry picked from commit 8ff06d5)

closes #24836

(cherry picked from commit 2066c4b)

closes #24837
davidby-influx added a commit that referenced this pull request Mar 27, 2024
Avoid unnecessarily deleting series from the series file
Log all errors on shard deletion

Closes #24834

(cherry picked from commit 8ff06d5)

closes #24836

(cherry picked from commit 2066c4b)

closes #24837
davidby-influx added a commit that referenced this pull request Apr 5, 2024
Avoid unnecessarily deleting series from the series file
Try harder to delete series from InMem indices
Log all errors on shard deletion

Closes #24834

(cherry picked from commit 8ff06d5)

closes #24835
davidby-influx added a commit that referenced this pull request Apr 8, 2024
Avoid unnecessarily deleting series from the series file
Try harder to delete series from InMem indices
Log all errors on shard deletion

Closes #24834

(cherry picked from commit 8ff06d5)

closes #24835
chengshiwen pushed a commit to chengshiwen/influxdb that referenced this pull request Aug 11, 2024
Avoid unnecessarily deleting series from the series file
Try harder to delete series from InMem indices
Log all errors on shard deletion

Closes influxdata#24834
chengshiwen pushed a commit to chengshiwen/influxdb that referenced this pull request Aug 27, 2024
Avoid unnecessarily deleting series from the series file
Try harder to delete series from InMem indices
Log all errors on shard deletion

Closes influxdata#24834
chengshiwen pushed a commit to chengshiwen/influxdb that referenced this pull request Aug 28, 2024
Avoid unnecessarily deleting series from the series file
Try harder to delete series from InMem indices
Log all errors on shard deletion

Closes influxdata#24834
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants