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 race on Cache entry #8885

Merged
merged 1 commit into from
Sep 27, 2017
Merged

Fix race on Cache entry #8885

merged 1 commit into from
Sep 27, 2017

Conversation

e-dard
Copy link
Contributor

@e-dard e-dard commented Sep 27, 2017

Required for all non-trivial PRs
  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated

Fixes a race on the Cache entry.

@e-dard e-dard requested a review from jwilder September 27, 2017 16:44
@@ -1331,7 +1331,9 @@ func (e *Engine) onFileStoreReplace(newFiles []TSMFile) {

// load metadata from the Cache
e.Cache.ApplyEntryFn(func(key []byte, entry *entry) error {
entry.mu.RLock()
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of touching the entries lock from the engine, can you change this to have a entry.InfluxQLType() instead that keeps the locking private to the entry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

@e-dard
Copy link
Contributor Author

e-dard commented Sep 27, 2017

@jwilder updated.

@e-dard e-dard merged commit e0cba44 into master Sep 27, 2017
@e-dard e-dard deleted the er-entry-race branch September 27, 2017 17:42
@e-dard e-dard mentioned this pull request Sep 27, 2017
3 tasks
@e-dard
Copy link
Contributor Author

e-dard commented Sep 27, 2017

Backport #8887

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.

2 participants