-
Notifications
You must be signed in to change notification settings - Fork 455
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
[dbnode] DB Close Wait for Fs Processes #2229
Conversation
src/dbnode/storage/mediator.go
Outdated
tickCheckInterval = 5 * time.Second | ||
fileOpCheckInterval = time.Second | ||
tickCheckInterval = 5 * time.Second | ||
completionCheckInterval = 1 * time.Second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could even make this every 100ms since it only happens on close. I remember the kill signal only gives us 10s to exit so the faster the better I suppose.
src/dbnode/storage/mediator.go
Outdated
"ongoing tick was unable to release time barrier", zap.Error(err)) | ||
continue | ||
log.Error("ongoing tick was unable to release time barrier", zap.Error(err)) | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, think this should still be a continue yeah?
src/dbnode/storage/mediator.go
Outdated
} | ||
|
||
func (m *mediator) databaseState() databaseState { | ||
db := m.database.(*db) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm this seems racy without acquiring a lock, also better to add to interface rather than casting to *db
.
Could you add a public method to type Database interface
just called IsOpen() bool
?
That way we can do the read lock from there too.
Codecov Report
@@ Coverage Diff @@
## r/fail-build-with-flush-erros #2229 +/- ##
===============================================================
+ Coverage 71.1% 72.4% +1.2%
===============================================================
Files 1021 1022 +1
Lines 88855 88892 +37
===============================================================
+ Hits 63254 64366 +1112
+ Misses 21258 20190 -1068
+ Partials 4343 4336 -7
Continue to review full report at Codecov.
|
a7a157a
to
3988202
Compare
3988202
to
c5cdfc5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What this PR does / why we need it:
Waits for fs processes to finish before closing db. Also checks db state before running a tick of fs processes.
Special notes for your reviewer:
Does this PR introduce a user-facing and/or backwards incompatible change?:
Does this PR require updating code package or user-facing documentation?: