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 #5940

Merged
merged 1 commit into from
Apr 25, 2024
Merged

Conversation

Shaddoll
Copy link
Member

What changed?

  • Fix checksum validation for SQL

Why?
There is a race condition with delete workflow. What could happen is that a delete workflow transaction can be committed between 2 concurrent read operations and in that case we can get checksum error because data is partially read.
Since checksum is stored in the executions table, we make it the last step of reading. And in this case, either we read full data with checksum or we don't get checksum and return error.

How did you test it?
unit tests

Potential risks

Release notes

Documentation Changes

Copy link

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.60%. Comparing base (869eb00) to head (094a8fe).

Additional details and impacted files
Files Coverage Δ
common/persistence/sql/sql_execution_store.go 85.25% <100.00%> (-0.02%) ⬇️

... and 6 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 869eb00...094a8fe. Read the comment docs.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 018f1752-5e18-4faa-b707-d8c13d57b31e

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • 37 unchanged lines in 12 files lost coverage.
  • Overall coverage increased (+0.007%) to 67.717%

Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 2 88.06%
common/task/fifo_task_scheduler.go 2 82.47%
common/persistence/sql/sqlplugin/mysql/task.go 2 73.68%
service/matching/db.go 2 73.23%
service/history/task/transfer_active_task_executor.go 2 72.72%
common/membership/hashring.go 2 84.69%
common/persistence/sql/sqlplugin/mysql/db.go 2 79.49%
common/persistence/historyManager.go 2 66.67%
common/log/tag/tags.go 3 50.46%
service/history/queue/timer_queue_processor_base.go 4 77.62%
Totals Coverage Status
Change from base Build 018f16ce-7f7b-4371-aa63-23d227cb3e34: 0.007%
Covered Lines: 99329
Relevant Lines: 146683

💛 - Coveralls

@Shaddoll Shaddoll merged commit 3a50a81 into cadence-workflow:master Apr 25, 2024
20 checks passed
@Shaddoll Shaddoll deleted the checksum branch April 25, 2024 22:50
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.

3 participants