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

Update Cassandra deletes to use ALL consistency level #4984

Merged
merged 1 commit into from
Sep 1, 2022

Conversation

Shaddoll
Copy link
Member

@Shaddoll Shaddoll commented Aug 31, 2022

What changed?

  • Update Cassandra deletes to use ALL consistency level

Why?

  • Use ALL consistency level for deletes to prevent data resurrection issue

How did you test it?
existing test
staging2 test

Potential risks
If deletes fail with ALL consistency level, we fallback to LOCAL_QUORUM consistency level. There should be no risk

Release notes

Documentation Changes

@coveralls
Copy link

coveralls commented Aug 31, 2022

Pull Request Test Coverage Report for Build 0182f9f9-a214-4254-97d5-f78a53a3dc3f

  • 19 of 59 (32.2%) changed or added relevant lines in 10 files are covered.
  • 80 unchanged lines in 10 files lost coverage.
  • Overall coverage increased (+0.002%) to 57.805%

Changes Missing Coverage Covered Lines Changed/Added Lines %
common/persistence/nosql/nosqlplugin/cassandra/visibility.go 0 1 0.0%
common/persistence/nosql/nosqlplugin/cassandra/domain.go 0 2 0.0%
common/persistence/nosql/nosqlplugin/cassandra/queue.go 0 3 0.0%
common/persistence/nosql/nosqlplugin/cassandra/gocql/public/client.go 0 6 0.0%
common/persistence/nosql/nosqlplugin/cassandra/workflow.go 5 11 45.45%
common/persistence/nosql/nosqlplugin/cassandra/tasks.go 1 10 10.0%
common/persistence/nosql/nosqlplugin/cassandra/db.go 6 19 31.58%
Files with Coverage Reduction New Missed Lines %
common/task/weightedRoundRobinTaskScheduler.go 2 89.12%
service/history/execution/mutable_state_util.go 2 36.14%
service/matching/matcher.go 2 91.46%
common/persistence/statsComputer.go 3 94.64%
service/history/task/fetcher.go 3 91.75%
service/matching/taskListManager.go 4 76.62%
common/task/fifoTaskScheduler.go 5 84.54%
common/persistence/nosql/nosqlplugin/cassandra/workflow.go 6 59.55%
common/persistence/nosql/nosqlplugin/cassandra/workflowUtils.go 19 75.29%
common/persistence/nosql/nosqlplugin/cassandra/workflowParsingUtils.go 34 83.16%
Totals Coverage Status
Change from base Build 0182f7d3-938e-44b3-b1b0-2754f1aa0016: 0.002%
Covered Lines: 84480
Relevant Lines: 146147

💛 - Coveralls

Copy link
Contributor

@ZackLK ZackLK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this tested?

@Shaddoll
Copy link
Member Author

Shaddoll commented Aug 31, 2022

How is this tested?

The existing persistence and integration tests.
Also tested on staging2 environment.

@Shaddoll Shaddoll force-pushed the delete-all branch 2 times, most recently from 3cf8a94 to 1340109 Compare August 31, 2022 23:15
Copy link
Contributor

@vytautas-karpavicius vytautas-karpavicius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of suggestions. Otherwise looks good.

func (c client) IsCassandraConsistencyError(err error) bool {
if req, ok := err.(gogocql.RequestError); ok {
// 0x1000 == UNAVAILABLE
return req.Code() == 0x1000
Copy link
Contributor

@vytautas-karpavicius vytautas-karpavicius Sep 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It may be worth defining private const for such magical values.

@Shaddoll Shaddoll merged commit a8e9e96 into cadence-workflow:master Sep 1, 2022
@Shaddoll Shaddoll deleted the delete-all branch September 23, 2022 00:02
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