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
librbd: don't read metadata twice on image open #18542
Conversation
@@ -274,6 +274,11 @@ struct C_InvalidateCache : public Context { | |||
trace_endpoint.copy_name(pname); | |||
perf_start(pname); | |||
|
|||
assert(image_watcher == NULL); | |||
image_watcher = new ImageWatcher<>(*this); |
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.
Any reason why the ImageWatcher
needs to be constructed prior to the refresh state machine? I grepped and didn't immediately see it being referenced (except for the change below to determine if it's safe to apply metadata string overrides).
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.
In refresh we create exclusive lock, and it (ManagedLock) references the watcher.
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.
Ack -- thanks
src/librbd/ImageCtx.cc
Outdated
image_watcher = new ImageWatcher<>(*this); | ||
} | ||
|
||
void ImageCtx::post_init() { |
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.
Nit: perhaps rename to init_cache
since it is for the cache and readahead (which technically requires the cache)
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.
@dillaman updated
After adding get_metadata to RefreshRequest it has become redundant in OpenRequest. Signed-off-by: Mykola Golub <to.my.trociny@gmail.com>
56a8365
to
0cb485e
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
After adding get_metadata to RefreshRequest it has become redundant
in OpenRequest.
Signed-off-by: Mykola Golub to.my.trociny@gmail.com