Skip to content

fix parallelRun lack snapshot ts - #16091

Merged
mergify[bot] merged 21 commits into
matrixorigin:mainfrom
YANGGMM:fix-16055
May 16, 2024
Merged

mergify[bot] merged 21 commits into
matrixorigin:mainfrom
YANGGMM:fix-16055

Conversation

@YANGGMM

@YANGGMM YANGGMM commented May 14, 2024

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #16062

What this PR does / why we need it:

fix parallelRun lack snapshot ts

@mergify mergify Bot added the kind/bug Something isn't working label May 14, 2024
@matrix-meow matrix-meow added the size/XS Denotes a PR that changes [1, 9] lines label May 14, 2024
@YANGGMM

YANGGMM commented May 14, 2024 •

Copy link
Copy Markdown
Contributor Author

have passed tpcc test
image

image

mo shutdown and restart test passed

image

cluster level snapshot passed
image

@matrix-meow

Copy link
Copy Markdown
Contributor

@YANGGMM Thanks for your contributions!

Pull Request Review:

Title:

The title of the pull request is clear and concise, indicating that the purpose of the changes is to fix an issue related to the lack of snapshot timestamp in the parallelRun function.

Body:

The body of the pull request provides relevant information about the type of PR (BUG), the specific issue it fixes (issue #16062), and the reason for the changes, which is to address the lack of snapshot timestamp in the parallelRun function.

Changes:

  1. Addition of Import Statement:

    • An import statement for timestamp package has been added in the scope.go file.
  2. Code Modification in ParallelRun Function:

    • Within the ParallelRun function, a check has been added to determine if the DataSource has a timestamp and if it is less than or equal to the SnapshotTS of the transaction operator. If this condition is met, a new transaction operator with a cloned snapshot operation using the DataSource timestamp is assigned to txnOp.
    • The Database function call now uses the updated txnOp variable when fetching the database, ensuring that the correct snapshot timestamp is used.

Suggestions for Improvement:

  1. Code Clarity and Readability:

    • Consider adding comments to explain the purpose of the new code block added within the ParallelRun function. This will help other developers understand the logic behind the snapshot timestamp check and assignment.
  2. Error Handling:

    • Ensure that proper error handling is in place for any potential errors that may occur during the snapshot timestamp check or the database retrieval process. This will help maintain the stability and reliability of the application.
  3. Optimization:

    • Since the snapshot timestamp check is only relevant for certain conditions, ensure that the check does not introduce unnecessary overhead when not needed. Optimize the logic to only perform the check when necessary to improve performance.
  4. Security Consideration:

    • Verify that the addition of snapshot timestamps does not introduce any security vulnerabilities, such as potential data leaks or unauthorized access. Conduct thorough testing to ensure the integrity and security of the system.
  5. Testing:

    • It is essential to include appropriate test cases to validate the functionality of the snapshot timestamp addition and ensure that it works as expected under various scenarios.

By addressing the above suggestions, the codebase can be enhanced in terms of clarity, robustness, performance, and security.

Overall, the pull request addresses the issue of the lack of snapshot timestamp in the parallelRun function effectively, but it is important to consider the mentioned improvements to further enhance the quality of the code changes.

@YANGGMM YANGGMM mentioned this pull request May 14, 2024
1 task done
@matrix-meow matrix-meow added size/S Denotes a PR that changes [10,99] lines and removed size/XS Denotes a PR that changes [1, 9] lines labels May 14, 2024
@YANGGMM
YANGGMM requested a review from aressu1985 as a code owner May 14, 2024 11:57
@YANGGMM
YANGGMM requested a review from a user May 14, 2024 11:57
@YANGGMM

YANGGMM commented May 15, 2024 •

Copy link
Copy Markdown
Contributor Author

2024-05-15 10:40:49 INFO jTPCC:804 - Term-00, Term-00, Running Average tpmTOTAL: 3647.19 Current tpmTOTAL: 19548 Memory Usage: 81MB / 130MB
2024-05-15 10:40:50 FATAL jTPCCTerminal:237 - [UNEXPECTED][STOCK_LEVEL][EXECUTION] ErrorCode : 20101, ErrorMessage : internal error: panic runtime error: slice bounds out of range [224:0]:
runtime.goPanicSliceB
/opt/homebrew/Cellar/go/1.21.6/libexec/src/runtime/panic.go:154
github.com/matrixorigin/matrixone/pkg/objectio.(*BlockInfoSlice).Slice
/Users/yangzhao/matrixone/pkg/objectio/block_info.go:124
github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).ParallelRun
/Users/yangzhao/matrixone/pkg/sql/compile/scope.go:548
github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).RemoteRun
/Users/yangzhao/matrixone/pkg/sql/compile/scope.go:296
github.com/matrixorigin/matrixone/pkg/sql/compile.(*Scope).MergeRun.func1
/Users/yangzhao/matrixone/pkg/sql/compile/scope.go:230
github.com/panjf2000/ants/v2.(*goWorker).run.func1
/Users/yangzhao/go/pkg/mod/github.com/panjf2000/ants/[email protected]/worker.go:67
runtime.goexit
/opt/homebrew/Cellar/go/1.21.6/libexec/src/runtime/asm_arm64.s:1197
image

@YANGGMM

YANGGMM commented May 16, 2024

Copy link
Copy Markdown
Contributor Author

测试两次均正常
image

image

@mergify
mergify Bot merged commit b601914 into matrixorigin:main May 16, 2024
YANGGMM added a commit to YANGGMM/matrixone that referenced this pull request May 16, 2024
fix parallelRun lack snapshot ts

Approved by: @ouyuanning, @heni02
fengttt pushed a commit to fengttt/matrixone that referenced this pull request May 7, 2026
fix parallelRun lack snapshot ts

Approved by: @ouyuanning, @heni02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants