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(tsi1): fix data race between appendEntry and FlushAndSync tsi1.(*LogFile) #25182

Merged
merged 2 commits into from
Jul 23, 2024

Conversation

chengshiwen
Copy link

@chengshiwen chengshiwen commented Jul 23, 2024

Closes #25181

Describe your proposed changes here.

  • I've read the contributing section of the project README.
  • Signed CLA (if not already signed).

From version 1.6.6 to 1.8.10, there are two relevant changes in tsdb/index/tsi1/log_file.go:

So this pull request first reverts 4ef4fe9, and then changes f.mu.RLock() to f.mu.Lock().

Then this issue did not recur.

@davidby-influx

@chengshiwen chengshiwen changed the title Master 1.x Fix data race between appendEntry and FlushAndSync tsi1.(*LogFile) Jul 23, 2024
@chengshiwen chengshiwen changed the title Fix data race between appendEntry and FlushAndSync tsi1.(*LogFile) fix(tsi1): Fix data race between appendEntry and FlushAndSync tsi1.(*LogFile) Jul 23, 2024
@chengshiwen chengshiwen changed the title fix(tsi1): Fix data race between appendEntry and FlushAndSync tsi1.(*LogFile) fix(tsi1): fix data race between appendEntry and FlushAndSync tsi1.(*LogFile) Jul 23, 2024
@chengshiwen
Copy link
Author

chengshiwen commented Jul 23, 2024

The ci/circleci: build_packages failed error is caused by Error pulling image (Picture 1), and the ci/circleci: unit_test_race error (Picture 2) does not appear on my local computer (Picture 3-4).

Picture-1
image

Picture-2
image

Picture-3
image

Picture-4
image

@davidby-influx davidby-influx self-requested a review July 23, 2024 17:07
@davidby-influx davidby-influx self-assigned this Jul 23, 2024
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. Thank you for your contribution!

@davidby-influx davidby-influx merged commit 7333da9 into influxdata:master-1.x Jul 23, 2024
12 of 15 checks passed
Copy link
Member

@gwossum gwossum left a comment

Choose a reason for hiding this comment

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

Looks good to me, too. Thanks!

chengshiwen added a commit to chengshiwen/influxdb that referenced this pull request Aug 11, 2024
…LogFile) (influxdata#25182)

Extend lock lifespan to encompass the 
flushAndSync() call to avoid a race

closes influxdata#25181
davidby-influx pushed a commit that referenced this pull request Aug 12, 2024
…LogFile) (#25182)

Extend lock lifespan to encompass the
flushAndSync() call to avoid a race

closes #25181

(cherry picked from commit 7333da9)

closes #25186
davidby-influx added a commit that referenced this pull request Aug 13, 2024
…LogFile) (#25182) (#25243)

Extend lock lifespan to encompass the
flushAndSync() call to avoid a race

closes #25181

(cherry picked from commit 7333da9)

closes #25186

Co-authored-by: Shiwen Cheng <chengshiwen0103@gmail.com>
chengshiwen added a commit to chengshiwen/influxdb that referenced this pull request Aug 27, 2024
…LogFile) (influxdata#25182)

Extend lock lifespan to encompass the 
flushAndSync() call to avoid a race

closes influxdata#25181
chengshiwen added a commit to chengshiwen/influxdb that referenced this pull request Aug 28, 2024
…LogFile) (influxdata#25182)

Extend lock lifespan to encompass the 
flushAndSync() call to avoid a race

closes influxdata#25181
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.

Data race between appendEntry and FlushAndSync tsi1.(*LogFile) on master-1.x
3 participants