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

Remove tenant shipper after prunning #6207

Merged
merged 3 commits into from
Mar 16, 2023

Conversation

fpetkovski
Copy link
Contributor

@fpetkovski fpetkovski commented Mar 10, 2023

We noticed another edge case with tenant prunning where the shipper would keep syncing blocks even after the tenant TSDB was removed. The reason for this is because the shipper runs in parallel in a different goroutine and is not stopped when the TSDB is gone.

This leads to empty shipper files being created on disk once a tenant is pruned, and the orphaned TSDBs alert from the mixing starts to fire.

This commit modifies the pruning logic to remove all components from a tenant once eviction conditions have been met.

image

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

  • Remove all tenant components after pruning.

Verification

  • I extended the existing test and run it locally with
go test -race ./pkg/receive/... -count 10 -run TestMultiTSDBPrune

We noticed another edge case with tenant prunning where the shipper would
keep syncing blocks even after the tenant TSDB was removed. The reason for this
is because the shipper runs in parallel in a different goroutine and is not
stopped when the TSDB is gone.

This leads to empty shipper files being created on disk once a tenant is pruned,
and the orphaned TSDBs alert from the mixing starts to fire.

This commit modifies the pruning logic to remove all components from a tenant
once eviction conditions have been met.

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
@@ -425,7 +425,7 @@ func TestMultiTSDBPrune(t *testing.T) {
name: "prune tsdbs with object storage",
bucket: objstore.NewInMemBucket(),
expectedTenants: 2,
expectedUploads: 1,
expectedUploads: 2,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now 2 because background syncs are constantly running, so the compacted tenant gets uploaded.

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
Copy link
Member

@saswatamcode saswatamcode left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@matej-g matej-g left a comment

Choose a reason for hiding this comment

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

👏

@matej-g matej-g merged commit e6bbef2 into thanos-io:main Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants