Refine Spiller to support append write#6862
Conversation
|
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by submitting an approval review. |
| @@ -55,8 +56,10 @@ class SpillHandler | |||
| size_t partition_id; | |||
| Int64 current_spilled_file_index; | |||
There was a problem hiding this comment.
need initialize current_spilled_file_index and current_append_write in constructor, others LGTM.
There was a problem hiding this comment.
They are inited in setUpNextSpilledFile, which is called in the constructor.
| /// Size of column data in memory (may be approximate) - for profiling. Zero, if could not be determined. | ||
| virtual size_t byteSize() const = 0; | ||
|
|
||
| virtual size_t estimateByteSizeForSpill() const { return byteSize(); } |
| @@ -63,24 +76,37 @@ void SpillHandler::spillBlocks(const Blocks & blocks) | |||
| try | |||
There was a problem hiding this comment.
Better add random fail point here to check.
| LOG_INFO(spiller->logger, "Spilled {} rows from {} blocks into temporary file, time cost: {:.3f} sec.", total_rows, block_size, cost); | ||
| RUNTIME_CHECK_MSG(current_spilled_file_index >= 0, "{}: spill after the spill handler is finished.", spiller->config.spill_id); | ||
| RUNTIME_CHECK_MSG(spiller->spill_finished == false, "{}: spill after the spiller is finished.", spiller->config.spill_id); | ||
| RUNTIME_CHECK_MSG(spiller->isSpillFinished() == false, "{}: spill after the spiller is finished.", spiller->config.spill_id); |
There was a problem hiding this comment.
why check finished at the end of the work?
There was a problem hiding this comment.
Because spillBlocks not hold the lock, and it is not allowed to spill blocks after the spiller is finished, so add the check here to eary exit if error happens.
4b596bb to
dd017f8
Compare
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
dd017f8 to
851ff60
Compare
Signed-off-by: xufei <xufei@pingcap.com>
Signed-off-by: xufei <xufei@pingcap.com>
Signed-off-by: xufei <xufei@pingcap.com>
|
/merge |
|
@windtalker: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. DetailsInstructions 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. |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 8cdc088 |
|
/run-unit-test |
|
/merge |
|
@windtalker: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. DetailsInstructions 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. |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 0692b9c |
|
/rebuild |
|
/run-integration-test |
1 similar comment
|
/run-integration-test |
|
/run-unit-test |
|
/merge |
|
@windtalker: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. DetailsInstructions 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. |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 8c28e99 |
* Refine `Spiller` to support append write (pingcap#6862) ref pingcap#6528 * fix build Signed-off-by: xufei <xufei@pingcap.com> * fix Signed-off-by: xufei <xufei@pingcap.com> * fix error Signed-off-by: xufei <xufei@pingcap.com> --------- Signed-off-by: xufei <xufei@pingcap.com>
What problem does this PR solve?
Issue Number: ref #6528
Problem Summary:
What is changed and how it works?
max_spilled_rows_per_fileandmax_spilled_bytes_per_filemax_spilled_size_per_spilltomax_cached_data_bytes_in_spillerand adjust the default value of it.append_dummy_read_streamtoSpiller::restoreBlocks, ifappend_dummy_read_streamis true,Spiller::restoreBlockswill return at leastmax_stream_sizestreams by appendingNullBlockInputStreamBlock::estimateByteSizeForSpillto estimate the uncompressed bytes when the block is spilled.Check List
Tests
Side effects
Documentation
Release note