Skip to content

Conversation

MichaelSnowden
Copy link
Contributor

What changed?
In this PR, I enabled the history scanner to delete unused history tree branches.

Why?
I made these changes for #3419 in order to rule this out as an option for why disk usage is increasing so much over time for NoSQL backends.

How did you test it?
I added a new test to the Scanner which verifies that we actually start the scavenger now regardless of the storage backend we're using.

Potential risks
The biggest risk I can think of is that this change could turn on the scavenger for NoSQL backends, and it could have a bug which causes it to remove branches which it shouldn't, which could interfere with workflow progress and lead to data loss.

Is hotfix candidate?
This PR is not a hot fix candidate which requires a notification to the broader community. However, we should tell the people on the original PR that this fix is in, so that they can patch it and see if it fixes their issue.

@MichaelSnowden MichaelSnowden force-pushed the nosql-history-scavenger branch from e1a04d7 to 2f41fdc Compare October 4, 2022 18:50
@MichaelSnowden MichaelSnowden force-pushed the nosql-history-scavenger branch from 2f41fdc to 6fbe551 Compare October 5, 2022 18:07
@MichaelSnowden MichaelSnowden marked this pull request as ready for review October 5, 2022 19:14
@MichaelSnowden MichaelSnowden requested a review from a team as a code owner October 5, 2022 19:14
Copy link
Member

@yycptt yycptt left a comment

Choose a reason for hiding this comment

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

The PR title should be for SQL backends not NoSQL?

go s.startWorkflowWithRetry(tlScannerWFStartOptions, tqScannerWFTypeName)
workerTaskQueueNames = append(workerTaskQueueNames, tqScannerTaskQueueName)
} else if s.context.cfg.Persistence.DefaultStoreType() == config.StoreTypeNoSQL && s.context.cfg.HistoryScannerEnabled() {
} else if s.context.cfg.HistoryScannerEnabled() {
Copy link
Member

Choose a reason for hiding this comment

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

else is not needed here? History scanner should be run if enabled regardless if task queue scanner is running or not I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure--that was the existing behavior

Copy link
Contributor Author

@MichaelSnowden MichaelSnowden Oct 10, 2022

Choose a reason for hiding this comment

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

I'll update it though because that makes sense to me

DefaultStore: config.StoreTypeSQL,
ExpectedScanners: []expectedScanner{executionScanner},
},
} {
Copy link
Member

Choose a reason for hiding this comment

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

Plz add a test case where store type is SQL and all three scanners are enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

@yux0
Copy link
Contributor

yux0 commented Oct 6, 2022

Is it to enable for SQL or NoSQL?

@MichaelSnowden MichaelSnowden changed the title Turns on the history scavenger for NoSQL backends Turns on the history scavenger for SQL backends Oct 10, 2022
@MichaelSnowden
Copy link
Contributor Author

Is it to enable for SQL or NoSQL?

SQL--changed the PR comment

@MichaelSnowden MichaelSnowden deleted the nosql-history-scavenger branch October 10, 2022 16:16
@MichaelSnowden
Copy link
Contributor Author

I accidentally closed this PR and deleted the old branch while trying to rename the branch. The new PR is here: #3462

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