-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Compactor: Downsample second pass creates duplicate blocks #7488
Comments
I was looking at the file Now that I'm looking in Before this change, the function The change to add in filtering moves that call to before the first pass, filters the list, and then passes
I will test and prepare a fix to regenerate the filtered list after the sync preceding the second pass. |
Regenerating the filtered list works, a single downsampled block is produced as expected. First pass:
Second pass:
No duplicate block is created. I don't have enough data in this bucket to test if it would do the 5m->1h downsampling in the second pass, but I expect it would. Preparing an MR. |
Thanos, Prometheus and Golang version used:
As from this image:
Prometheus is version
2.51.2
but shouldn't be relevant.Object Storage Provider:
NetApp ONTAP S3, using generic S3 config.
What happened:
On the second downsampling pass, the compactor creates duplicates of blocks that were created during the first pass.
First pass:
Second pass:
The block
01J19GEH5AKEHPGAVAQXS2E0TD
is downsampled into two duplicate blocks01J19GFGYACEHGJBP3C87GA0QB
and01J19GH72N2FD744DPMT4FYCAZ
.By deleting both of those blocks, I can get it to consistently repeat the same process.
On the next GC pass, the duplicate block is marked for deletion:
I have tried deleting the duplicate block manually (instead of waiting), and the compactor does not recreate it.
My assumption was that the NetApp S3 storage does not provide strong consistency, and so with the second metadata sync only taking place 0.2 seconds after the upload of the previous block, that it did not see the newly uploaded block.
I can't find any NetApp documentation that either supports or refutes that assumption, though.
And from some testing with a python script using boto3, using
list_objects
andupload_file
functions, it always returns the new object immediately after uploading it.To test further, I copied all data from the bucket over to a completely different object store, using Ceph's object gateway S3 API, and switched the compactor to point to that.
I have another setup of thanos using this same object store on an older v0.31.0, which has been running for around a year and I have never seen this duplication issue with it.
On the second object store I saw exactly the same behaviour. First pass:
And the second pass:
And marking for deletion:
The meta.json files of these two blocks, identical apart from the final block ID:
01J1AJWS9MPHRDR4FJ3Z6YH733-meta.json
01J1AJTGV25ZA71G5N1Z7YNCSC-meta.json
At this point I'm fairly confident that it isn't something related to the storage backend, and it must be something introduced since v0.31.0.
What you expected to happen:
Downsampling should not create duplicate blocks.
How to reproduce it (as minimally and precisely as possible):
Is affecting downsampling of 2-days blocks to 5m resolution on two different storage backends, one of which was previously known good.
I haven't tested with a more standard AWS or GCS storage, but I could try that if needed.
Full logs to relevant components:
Anything else we need to know:
The text was updated successfully, but these errors were encountered: