Skip to content

Commit 92b8758

Browse files
Add an integration test for durable archival (#3732)
1 parent c912454 commit 92b8758

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed

common/dynamicconfig/constants.go

+2
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,8 @@ const (
524524
ArchivalProcessorRetryWarningLimit = "history.archivalProcessorRetryLimitWarning"
525525
// ArchivalBackendMaxRPS is the maximum rate of requests per second to the archival backend
526526
ArchivalBackendMaxRPS = "history.archivalBackendMaxRPS"
527+
// DurableArchivalEnabled is the flag to enable durable archival
528+
DurableArchivalEnabled = "history.durableArchivalEnabled"
527529

528530
// ReplicatorTaskBatchSize is batch size for ReplicatorProcessor
529531
ReplicatorTaskBatchSize = "history.replicatorTaskBatchSize"

host/archival_test.go

+24-4
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ type archivalSuite struct {
6868
}
6969

7070
func (s *archivalSuite) SetupSuite() {
71-
s.dynamicConfigOverrides = map[dynamicconfig.Key]interface{}{
72-
dynamicconfig.RetentionTimerJitterDuration: time.Second,
73-
}
7471
s.setupSuite("testdata/integration_test_cluster.yaml")
7572
}
7673

@@ -85,7 +82,30 @@ func (s *archivalSuite) SetupTest() {
8582

8683
func TestArchivalSuite(t *testing.T) {
8784
flag.Parse()
88-
suite.Run(t, new(archivalSuite))
85+
for _, c := range []struct {
86+
Name string
87+
DurableArchivalIsEnabled bool
88+
}{
89+
{
90+
Name: "DurableArchivalIsDisabled",
91+
DurableArchivalIsEnabled: false,
92+
},
93+
{
94+
Name: "DurableArchivalIsEnabled",
95+
DurableArchivalIsEnabled: true,
96+
},
97+
} {
98+
c := c
99+
t.Run(c.Name, func(t *testing.T) {
100+
s := new(archivalSuite)
101+
s.dynamicConfigOverrides = map[dynamicconfig.Key]interface{}{
102+
dynamicconfig.RetentionTimerJitterDuration: time.Second,
103+
dynamicconfig.ArchivalProcessorArchiveDelay: time.Duration(0),
104+
dynamicconfig.DurableArchivalEnabled: c.DurableArchivalIsEnabled,
105+
}
106+
suite.Run(t, s)
107+
})
108+
}
89109
}
90110

91111
func (s *archivalSuite) TestArchival_TimerQueueProcessor() {

service/history/configs/config.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,7 @@ func NewConfig(dc *dynamicconfig.Collection, numberOfShards int32, isAdvancedVis
425425
NumArchiveSystemWorkflows: dc.GetIntProperty(dynamicconfig.NumArchiveSystemWorkflows, 1000),
426426
ArchiveRequestRPS: dc.GetIntProperty(dynamicconfig.ArchiveRequestRPS, 300), // should be much smaller than frontend RPS
427427
ArchiveSignalTimeout: dc.GetDurationProperty(dynamicconfig.ArchiveSignalTimeout, 300*time.Millisecond),
428-
DurableArchivalEnabled: func() bool {
429-
// Always return false for now until durable archival is tested end-to-end
430-
return false
431-
},
428+
DurableArchivalEnabled: dc.GetBoolProperty(dynamicconfig.DurableArchivalEnabled, false),
432429

433430
BlobSizeLimitError: dc.GetIntPropertyFilteredByNamespace(dynamicconfig.BlobSizeLimitError, 2*1024*1024),
434431
BlobSizeLimitWarn: dc.GetIntPropertyFilteredByNamespace(dynamicconfig.BlobSizeLimitWarn, 512*1024),

service/history/queueFactoryBase.go

+4
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ var QueueModule = fx.Options(
109109
Group: QueueFactoryFxGroup,
110110
Target: NewVisibilityQueueFactory,
111111
},
112+
fx.Annotated{
113+
Group: QueueFactoryFxGroup,
114+
Target: NewArchivalQueueFactory,
115+
},
112116
),
113117
fx.Invoke(QueueFactoryLifetimeHooks),
114118
)

0 commit comments

Comments
 (0)