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

Start the archival queue iff history or visibility archival is enabled in the static config #3827

Merged
merged 2 commits into from
Jan 24, 2023

Conversation

MichaelSnowden
Copy link
Contributor

What changed?
^title

Why?
We don't want to start the archival queue if there's no possibility that archival tasks will even be produced because a lot of users don't even use this feature.

How did you test it?
I added several unit tests to the QueueModule which verify that the archival queue factory is only provided conditionally, but all other queues are always provided.

Potential risks
None

Is hotfix candidate?
No

@MichaelSnowden MichaelSnowden force-pushed the snowden/start-archival-queue-conditionally branch from 46876a6 to 2c9c966 Compare January 23, 2023 18:48
@MichaelSnowden MichaelSnowden marked this pull request as ready for review January 23, 2023 18:49
@MichaelSnowden MichaelSnowden requested a review from a team as a code owner January 23, 2023 18:49
@@ -52,6 +52,7 @@ type (
ReadEnabled() bool
GetNamespaceDefaultState() enumspb.ArchivalState
GetNamespaceDefaultURI() string
StaticClusterState() ArchivalState
Copy link
Contributor

Choose a reason for hiding this comment

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

can it use GetClusterState()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See below comment

queueFactorySet.TimerQueueFactory,
queueFactorySet.VisibilityQueueFactory,
}
if archivalMetadata.GetHistoryConfig().StaticClusterState() == archiver.ArchivalEnabled || archivalMetadata.GetVisibilityConfig().StaticClusterState() == archiver.ArchivalEnabled {
Copy link
Contributor

Choose a reason for hiding this comment

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

can it call ClusterConfiguredForArchival?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No because that can change based on the dynamic config, and so we need to turn it on during startup using the static config because otherwise the dynamic config for durable archival may turn on, and then we'll start producing tasks to a queue which is not running:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Make sense to me now. I guess this will be simplified after deprecate the archival workflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, not really. The durable archival flag will be removed, but the two-tier archival switch will still exist, and we actually need to keep it that way.

@MichaelSnowden MichaelSnowden enabled auto-merge (squash) January 24, 2023 22:25
@MichaelSnowden MichaelSnowden merged commit 285bf33 into master Jan 24, 2023
@MichaelSnowden MichaelSnowden deleted the snowden/start-archival-queue-conditionally branch January 24, 2023 22:51
MichaelSnowden added a commit that referenced this pull request Jan 31, 2023
…d in the static config (#3827)

Enable archival queue factory iff it is enabled in the static config
MichaelSnowden added a commit that referenced this pull request Feb 3, 2023
…d in the static config (#3827)

Enable archival queue factory iff it is enabled in the static config
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.

2 participants