Skip to content

fix parallelRun lack snapshot ts (#1.2-dev) - #16174

Merged
mergify[bot] merged 3 commits into
matrixorigin:1.2-devfrom
YANGGMM:fix-snapshot-partition-1.2-dev
May 17, 2024
Merged

mergify[bot] merged 3 commits into
matrixorigin:1.2-devfrom
YANGGMM:fix-snapshot-partition-1.2-dev

Conversation

@YANGGMM

@YANGGMM YANGGMM commented May 16, 2024

Copy link
Copy Markdown
Contributor

fix parallelRun lack snapshot ts

Approved by: @ouyuanning, @heni02

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

fix parallelRun lack snapshot ts

Approved by: @ouyuanning, @heni02
@matrix-meow matrix-meow added the size/S Denotes a PR that changes [10,99] lines label May 16, 2024
@mergify
mergify Bot requested a review from sukki37 May 16, 2024 06:10
@mergify mergify Bot added the kind/bug Something isn't working label May 16, 2024
@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 fix is related to the lack of snapshot timestamp in the parallelRun function.

Body:

The body of the pull request provides essential information about the type of PR, the specific issue it fixes, and why the fix is necessary. It also lists the approvals from relevant team members, which is a good practice for tracking and accountability.

Changes:

  1. In the compile.go file:

    • The changes involve removing commented-out code related to ScanTS and replacing LessEq with Less for comparison between timestamps in multiple places.
    • The modification ensures that the txnOp is updated correctly based on the comparison of timestamps.
  2. In the operator.go file:

    • Similar changes are made to replace LessEq with Less for timestamp comparison.
  3. In the scope.go file:

    • The ParallelRun function now includes logic to update txnOp based on the comparison of timestamps, ensuring the correct snapshot is used.

Suggestions for Improvement:

  1. Remove Commented-Out Code:

    • The commented-out code in the compile.go file should be removed entirely to maintain code cleanliness and avoid confusion for future developers.
  2. Consistent Timestamp Comparison:

    • Ensure consistency in timestamp comparison throughout the codebase. It's good to use a standardized approach for comparing timestamps to avoid potential bugs or confusion.
  3. Optimization:

    • Consider refactoring the timestamp comparison logic into a separate function to promote code reusability and improve readability.
  4. Security Consideration:

    • While the changes seem focused on functionality, ensure that the modifications do not introduce any security vulnerabilities. Review the timestamp handling to prevent any potential time-based attacks.
  5. Testing:

    • It would be beneficial to include test cases that cover the scenarios related to timestamp comparisons to validate the correctness of the changes.

By addressing these suggestions, the codebase can be enhanced in terms of readability, maintainability, and potentially security aspects.

test refactor restore synatx

Approved by: @heni02
@YANGGMM
YANGGMM requested a review from aressu1985 as a code owner May 17, 2024 01:51
@YANGGMM
YANGGMM requested a review from a user May 17, 2024 01:51
@mergify
mergify Bot merged commit 7256fe4 into matrixorigin:1.2-dev May 17, 2024
@YANGGMM
YANGGMM deleted the fix-snapshot-partition-1.2-dev branch June 3, 2024 07:45
@aylei aylei mentioned this pull request Jun 5, 2024
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.

4 participants