-
Notifications
You must be signed in to change notification settings - Fork 807
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
Prevent read on TSDB once closeAllTSDB function has been called #4304
Prevent read on TSDB once closeAllTSDB function has been called #4304
Conversation
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.
Thank you for working on this. I think we should just use ingester's state to reject queries. In practice difference between entering Stopping and calling closeAllTSDB is tiny.
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.
Would it be less repetitive to do the check in i.getTSDB()
?
I advocated against that. I think having it on read path is more explicit than returning |
Sorry, I missed that discussion. Did you talk about returning an error? |
I can change it to return an error from |
My opinion is that simple "getter" should simply return element from map, and not check for internal state of the ingester. This state only affects read-path, where it should be checked. |
Not sure I get this part. We wouldn't want to reopen a TSDB for write, would we? |
Right, we wouldn't. What I was trying to say is to add checks to read methods for this state – because that is where it will be more explicit, instead of getter. On write path, we could either use |
Signed-off-by: ilangofman <igofman99@gmail.com>
Signed-off-by: ilangofman <igofman99@gmail.com>
Signed-off-by: ilangofman <igofman99@gmail.com>
Signed-off-by: ilangofman <igofman99@gmail.com>
Signed-off-by: ilangofman <igofman99@gmail.com>
Signed-off-by: ilangofman <igofman99@gmail.com>
Signed-off-by: ilangofman <igofman99@gmail.com>
27d9865
to
0267a21
Compare
Signed-off-by: ilangofman <igofman99@gmail.com>
Signed-off-by: ilangofman <igofman99@gmail.com>
Signed-off-by: ilangofman <igofman99@gmail.com>
18387bf
to
3c4798b
Compare
Signed-off-by: ilangofman <igofman99@gmail.com>
Signed-off-by: ilangofman <igofman99@gmail.com>
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.
Looking good now, but I think we can get away without the duplication in Push()
.
Signed-off-by: ilangofman <igofman99@gmail.com>
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.
Great! 🎉
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.
Looks great! Thank you!
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, thank you!
…exproject#4304) * Prevent read on TSDB once closeAllTSDB function has been called Signed-off-by: ilangofman <igofman99@gmail.com> * Fix formatting issues Signed-off-by: ilangofman <igofman99@gmail.com> * Address PR comments and remove unit test no longer required Signed-off-by: ilangofman <igofman99@gmail.com> * Remove closed bool no longer used Signed-off-by: ilangofman <igofman99@gmail.com> * Remove error no longer used Signed-off-by: ilangofman <igofman99@gmail.com> * Remove comment and change return var Signed-off-by: ilangofman <igofman99@gmail.com> * Update log message to debug Signed-off-by: ilangofman <igofman99@gmail.com> * Moved log message to separate function Signed-off-by: ilangofman <igofman99@gmail.com> * change function name for checking if tsdb is closing Signed-off-by: ilangofman <igofman99@gmail.com> * ingester should read/write only when state is running for block store Signed-off-by: ilangofman <igofman99@gmail.com> * Move running check to ingester v2 file Signed-off-by: ilangofman <igofman99@gmail.com> * Remove extra space Signed-off-by: ilangofman <igofman99@gmail.com> * Remove duplication from push func Signed-off-by: ilangofman <igofman99@gmail.com> Signed-off-by: Alvin Lin <alvinlin@amazon.com>
What this PR does:
Added another variable in the
TSDBState
that prevents any read occurring on the TSDB once the ingester has called thecloseAllTSDB
function.Which issue(s) this PR fixes:
Fixes #3350
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]