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 measure #20912

Merged
merged 2 commits into from
Mar 10, 2021

Conversation

davidby-influx
Copy link
Contributor

@davidby-influx davidby-influx commented Mar 9, 2021

…ments (#20504)

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.

Fixes #20500

(cherry picked from commit fe3af66)

davidby-influx and others added 2 commits March 9, 2021 15:09
…ments (#20504)

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.

Fixes #20500

(cherry picked from commit fe3af66)
@davidby-influx davidby-influx merged commit 283ea0e into 1.8 Mar 10, 2021
@davidby-influx davidby-influx deleted the DSB_lock_contention branch March 10, 2021 00:10
@davidby-influx davidby-influx linked an issue Mar 15, 2021 that may be closed by this pull request
been2io pushed a commit to been2io/influxdb that referenced this pull request Apr 1, 2021
* '1.8' of github.com:influxdata/influxdb: (41 commits)
  chore: Late to the party fix for influxdata/plutonium#3339 (influxdata#21080)
  fix: fix help test for influx_inspect (influxdata#21052) (influxdata#21053)
  fix: Set go version to 1.13 in go.mod; see influxdata/plutonium#3339 (influxdata#21034)
  refactor: separate coarse and fine permission interfaces (influxdata#20996) (influxdata#21035)
  feat: Log query text for POST requests (influxdata#20993) (influxdata#21021)
  feat: influx_inspect export to standard out (influxdata#20977) (influxdata#20989)
  feat(inspect): Add report-disk for disk usage by measurement (influxdata#20917)
  fix: infinite recursion bug (influxdata#20862) (influxdata#20914)
  fix(tsdb): minimize lock contention when adding new fields or measure (influxdata#20912)
  fix(tsm1): fix data race when accessing tombstone stats (influxdata#20909)
  Update changelog
  feat: Make meta queries respect QueryTimeout values (influxdata#20910)
  chore: run goimports on 1.8 branch to bring it up to new check-in standards (influxdata#20907)
  fix(error): SELECT INTO doesn't return error with unsupported value (influxdata#20429) (influxdata#20432)
  build: switch tested centos base images (influxdata#20417) (influxdata#20418)
  chore: update CHANGELOG.md for typo and community PR (influxdata#20389)
  fix(prometheus): regexp handling should comply with PromQL (influxdata#19832)
  fix: cp.Mux.Serve() closes all net.Listener instances silently on error (influxdata#20295)
  Update changelog
  chore: fix CHANGELOG formating (influxdata#20286)
  ...
been2io pushed a commit to been2io/influxdb that referenced this pull request Apr 2, 2021
* 1.8: (41 commits)
  chore: Late to the party fix for influxdata/plutonium#3339 (influxdata#21080)
  fix: fix help test for influx_inspect (influxdata#21052) (influxdata#21053)
  fix: Set go version to 1.13 in go.mod; see influxdata/plutonium#3339 (influxdata#21034)
  refactor: separate coarse and fine permission interfaces (influxdata#20996) (influxdata#21035)
  feat: Log query text for POST requests (influxdata#20993) (influxdata#21021)
  feat: influx_inspect export to standard out (influxdata#20977) (influxdata#20989)
  feat(inspect): Add report-disk for disk usage by measurement (influxdata#20917)
  fix: infinite recursion bug (influxdata#20862) (influxdata#20914)
  fix(tsdb): minimize lock contention when adding new fields or measure (influxdata#20912)
  fix(tsm1): fix data race when accessing tombstone stats (influxdata#20909)
  Update changelog
  feat: Make meta queries respect QueryTimeout values (influxdata#20910)
  chore: run goimports on 1.8 branch to bring it up to new check-in standards (influxdata#20907)
  fix(error): SELECT INTO doesn't return error with unsupported value (influxdata#20429) (influxdata#20432)
  build: switch tested centos base images (influxdata#20417) (influxdata#20418)
  chore: update CHANGELOG.md for typo and community PR (influxdata#20389)
  fix(prometheus): regexp handling should comply with PromQL (influxdata#19832)
  fix: cp.Mux.Serve() closes all net.Listener instances silently on error (influxdata#20295)
  Update changelog
  chore: fix CHANGELOG formating (influxdata#20286)
  ...

# Conflicts:
#	cmd/influxd/run/server.go
#	go.sum
#	services/httpd/service.go
#	storage/reads/datatypes/predicate.pb.go
#	storage/reads/datatypes/storage_common.pb.go
been2io pushed a commit to been2io/influxdb that referenced this pull request Apr 2, 2021
* seriescache: (41 commits)
  chore: Late to the party fix for influxdata/plutonium#3339 (influxdata#21080)
  fix: fix help test for influx_inspect (influxdata#21052) (influxdata#21053)
  fix: Set go version to 1.13 in go.mod; see influxdata/plutonium#3339 (influxdata#21034)
  refactor: separate coarse and fine permission interfaces (influxdata#20996) (influxdata#21035)
  feat: Log query text for POST requests (influxdata#20993) (influxdata#21021)
  feat: influx_inspect export to standard out (influxdata#20977) (influxdata#20989)
  feat(inspect): Add report-disk for disk usage by measurement (influxdata#20917)
  fix: infinite recursion bug (influxdata#20862) (influxdata#20914)
  fix(tsdb): minimize lock contention when adding new fields or measure (influxdata#20912)
  fix(tsm1): fix data race when accessing tombstone stats (influxdata#20909)
  Update changelog
  feat: Make meta queries respect QueryTimeout values (influxdata#20910)
  chore: run goimports on 1.8 branch to bring it up to new check-in standards (influxdata#20907)
  fix(error): SELECT INTO doesn't return error with unsupported value (influxdata#20429) (influxdata#20432)
  build: switch tested centos base images (influxdata#20417) (influxdata#20418)
  chore: update CHANGELOG.md for typo and community PR (influxdata#20389)
  fix(prometheus): regexp handling should comply with PromQL (influxdata#19832)
  fix: cp.Mux.Serve() closes all net.Listener instances silently on error (influxdata#20295)
  Update changelog
  chore: fix CHANGELOG formating (influxdata#20286)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fields.idx frequent writes cause lock contention [Backport #20500 to 1.8]
2 participants