Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

compact/write: Don't write down empty blocks (?) #309

Closed
bwplotka opened this issue Mar 22, 2018 · 1 comment
Closed

compact/write: Don't write down empty blocks (?) #309

bwplotka opened this issue Mar 22, 2018 · 1 comment

Comments

@bwplotka
Copy link
Contributor

bwplotka commented Mar 22, 2018

I had no samples for a while in my Prometheus (because of wrong scraping configuration?). TSDB dumped empty block into my disk which looks like this:

01C6XA7C2K2EJKV6GGWQCGNYTC/
-- index (39.53 KB)
-- meta.json (408 B)
-- chunks/
     < empty dir >

Meta file:

{
    "version": 1,
    "ulid": "01C6XA7C2K2EJKV6GGWQCGNYTC",
    "minTime": 1519236000000,
    "maxTime": 1519243200000,
    "stats": {},
    "compaction": {
        "level": 1,
        "sources": [
            "01C6XA7C2K2EJKV6GGWQCGNYTC"
        ]
    },
}

This causes some tiny problems in Thanos that we need to workaround, but my main questions are:

  1. Have you seen that before? How often can that happen?
  2. Is that necessary to produce those?

In my personal opinion, it can cause lot's of unnecessary compactions (and downsampling for Thanos) and index lookups. It gets even worse for Thanos or other long storage solutions, because these lookups & compactions are bit more expensive.

Do you think we can just don't write empty blocks down?

The only negative consequence I can think of is the inability to tell from the storage perspective (looking on the blocks) if the Prom/TSDB was down or just Prometheus did not scrape anything (no samples in TSDB).

@gouthamve
Copy link
Collaborator

Even I think that writing empty blocks can be removed.

See: #245

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants