Skip to content
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

Fix checksum validation for SQL implementation #5790

Merged
merged 3 commits into from
Mar 18, 2024

Conversation

Shaddoll
Copy link
Contributor

@Shaddoll Shaddoll commented Mar 15, 2024

What changed?
Add a check for the SQL implementation of GetWorkflowExecution operation to exclude false positive checksum validation failure cases.

Why?
To make sure the checksum validation result is true, the data we read from GetWorkflowExecution operation are from a consistent view. In the NoSQL implementation, the operation is a single read, so the data is from a consistent view. However, in the SQL implementation, the operation is multiple reads from different table. If there is a concurrent update, the data we read isn't from a consistent view and the checksum validation could fail. Normally, we don't have concurrent updates with reads. But when the shard ownership changed, it might not be the case.

How did you test it?
unit tests

Potential risks

Release notes

Documentation Changes

common/persistence/executionManager.go Outdated Show resolved Hide resolved
service/history/execution/context.go Outdated Show resolved Hide resolved
common/persistence/sql/sql_execution_store.go Outdated Show resolved Hide resolved
common/persistence/sql/sql_execution_store.go Outdated Show resolved Hide resolved
@Shaddoll Shaddoll force-pushed the checksum branch 3 times, most recently from bf45163 to a26b329 Compare March 16, 2024 01:22
Copy link

codecov bot commented Mar 16, 2024

Codecov Report

Merging #5790 (1ffbfe7) into master (d43b582) will increase coverage by 0.02%.
The diff coverage is 95.45%.

❗ Current head 1ffbfe7 differs from pull request most recent head 1a507ab. Consider uploading reports for the commit 1a507ab to get more accurate results

Additional details and impacted files
Files Coverage Δ
common/persistence/data_manager_interfaces.go 98.38% <ø> (ø)
common/persistence/data_store_interfaces.go 100.00% <ø> (ø)
common/persistence/serializer.go 76.20% <100.00%> (+0.92%) ⬆️
common/persistence/sql/sql_execution_store.go 86.79% <100.00%> (+1.63%) ⬆️
service/history/shard/context.go 30.54% <100.00%> (+0.31%) ⬆️
common/persistence/executionManager.go 0.00% <0.00%> (ø)

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d43b582...1a507ab. Read the comment docs.

@Shaddoll Shaddoll force-pushed the checksum branch 7 times, most recently from 7ffd197 to 9879c0f Compare March 16, 2024 03:52
@coveralls
Copy link

coveralls commented Mar 16, 2024

Pull Request Test Coverage Report for Build 018e538a-9212-4a38-a4bc-aa8f4e5a06ec

Details

  • 24 of 26 (92.31%) changed or added relevant lines in 5 files are covered.
  • 74 unchanged lines in 10 files lost coverage.
  • Overall coverage decreased (-0.008%) to 64.923%

Changes Missing Coverage Covered Lines Changed/Added Lines %
common/persistence/persistence-tests/persistenceTestBase.go 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 2 89.05%
client/history/client.go 2 35.78%
service/history/handler/handler.go 2 49.59%
service/matching/taskListManager.go 2 79.7%
service/history/execution/mutable_state_util.go 2 78.48%
common/persistence/sql/sql_execution_store_util.go 3 84.82%
service/frontend/api/handler.go 4 62.11%
service/history/engine/engineimpl/historyEngine.go 9 68.3%
service/history/task/transfer_standby_task_executor.go 10 86.19%
service/history/execution/mutable_state_task_refresher.go 38 56.65%
Totals Coverage Status
Change from base Build 018e5375-7faa-4355-92c2-53b7ff622a40: -0.008%
Covered Lines: 94770
Relevant Lines: 145972

💛 - Coveralls

@Shaddoll Shaddoll force-pushed the checksum branch 3 times, most recently from b3cd4eb to 40810ba Compare March 18, 2024 16:23
@Shaddoll Shaddoll merged commit d60041f into cadence-workflow:master Mar 18, 2024
18 checks passed
@Shaddoll Shaddoll deleted the checksum branch March 18, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants