-
Notifications
You must be signed in to change notification settings - Fork 411
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
Extract common parts of ApplySnapshot #8110
Extract common parts of ApplySnapshot #8110
Conversation
Signed-off-by: CalvinNeo <[email protected]>
Signed-off-by: CalvinNeo <[email protected]>
Signed-off-by: CalvinNeo <[email protected]>
@@ -0,0 +1,95 @@ | |||
// Copyright 2023 PingCAP, Inc. |
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.
Moved out from SSTFilesToBlockInputStream, with some header files excluded.
Signed-off-by: CalvinNeo <[email protected]>
|
||
#include <future> | ||
|
||
namespace DB | ||
{ | ||
template <typename Key, typename Func, typename R> |
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.
Intentionally, a packaged_task
can be created from Func
, which returns an R
that is convertible from result_of(Func)
.
} | ||
catch (DB::Exception & e) | ||
{ | ||
if (e.code() == ErrorCodes::TABLE_IS_DROPPED) |
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.
The TABLE_IS_DROPPED
exception here can still be thrown by some AtomicGetStorageSchema
.
} | ||
catch (DB::Exception & e) | ||
{ | ||
if (stream != nullptr) |
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.
stream is released in readFromStream
when abort.
.dt_disk_bytes = stream->getTotalBytesOnDisk(), | ||
.dt_total_bytes = stream->getTotalCommittedBytes()}}); | ||
} | ||
catch (DB::Exception & e) |
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.
We release sst_stream here
/run-all-tests |
Signed-off-by: CalvinNeo <[email protected]>
Signed-off-by: CalvinNeo <[email protected]>
Co-authored-by: JaySon <[email protected]>
Co-authored-by: JaySon <[email protected]>
Co-authored-by: JaySon <[email protected]>
Co-authored-by: JaySon <[email protected]>
Signed-off-by: CalvinNeo <[email protected]>
…nto refactor-applysnapshot2
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.
The rest LGTM
Co-authored-by: JaySon <[email protected]>
Signed-off-by: CalvinNeo <[email protected]>
…nto refactor-applysnapshot2
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hongyunyan, JaySon-Huang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
@CalvinNeo: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests
If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/run-all-tests |
What problem does this PR solve?
Issue Number: ref #8081
Problem Summary:
This is the second part of single big region snapshot handling. It mainly did the following:
AsyncTasks
as a common utilSSTFilesToBlockInputStream
's arguments intoSSTFilesToBlockInputStreamOpts
readFromStream
readFromStream
return error code rather than exception for recoverable errorWhat is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note