Skip to content

Bug: OpenTSDB returning only partial results due to race condition #1753

@muffix

Description

@muffix

I have noticed that for a small number of queries I was only getting partial results. Looking at the detailed scanner stats, it seems like the results of a single scanner are missing entirely, despite all scanners completing successfully. In our setup with 8 salt buckets, I was missing almost exactly one eighth of the data points.

This seems to impact all queries, but only when a race condition occurs.

Looking at the SaltScanner code, the call to getCount() of the CountdownLatch here is not thread-safe, but the result is used as the key for the map in which the scanners' results are stored. If then two scanners both decrement the latch and then read the same numner, the second one would overwrite the entire results of the first one, which causes them to miss in the final response.

Happy to put in a PR to get that fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions