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(tsdb): minimize lock contention when adding new fields or measurements #21228

Merged
merged 4 commits into from
Apr 15, 2021

Conversation

danxmoran
Copy link
Contributor

Closes #20502

Forward-ports #20504

davidby-influx and others added 2 commits April 15, 2021 13:16
…ments

fields.idx frequent writes cause lock contention and fields.idx is recreated
when a field or measurement is added in a WritePointsWithContext()
This eliminates locking during the actual file rewrite, and limits it to
the times when the MeasurementFieldSet is actually being read or written
in memory and when the new file is being renamed.

Test verification of correct behavior by checking the fields.idx
file matches the in-memory copy after heavily parallel measurement addition.
Copy link
Contributor

@davidby-influx davidby-influx left a comment

Choose a reason for hiding this comment

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

LGTM. I should probably pick up the test change in the other branches at some point.

@danxmoran
Copy link
Contributor Author

cross_build failed because DockerHub is down. I trust that nothing here should affect the build process, so proceeding with the merge.

@danxmoran danxmoran merged commit 7b1763e into master Apr 15, 2021
@danxmoran danxmoran deleted the dm-forward-port-fields-idx-perf-20502 branch April 15, 2021 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fields.idx frequent writes cause lock contention [2.x]
2 participants