Skip to content

Commit 75bc3f8

Browse files
authored
Revert "Made the TTLBufferDays configurable (cadence-workflow#5354)" (cadence-workflow#5379)
This reverts commit 47f83ed.
1 parent 818cdb7 commit 75bc3f8

File tree

5 files changed

+3
-21
lines changed

5 files changed

+3
-21
lines changed

common/dynamicconfig/constants.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,13 +1408,6 @@ const (
14081408
LargeShardHistoryBlobMetricThreshold
14091409
// LastIntKey must be the last one in this const group
14101410
LastIntKey
1411-
1412-
// TTLBufferDays are the buffer days added into the TTL time for security reasons.
1413-
// KeyName: system.TTLBufferDays
1414-
// Value type: Int
1415-
// Default value: 15
1416-
// Allowed filters: N/A
1417-
TTLBufferDays
14181411
)
14191412

14201413
const (
@@ -3630,11 +3623,6 @@ var IntKeys = map[IntKey]DynamicInt{
36303623
Description: "The number of attempts to push Isolation group configuration to the config store",
36313624
DefaultValue: 2,
36323625
},
3633-
TTLBufferDays: DynamicInt{
3634-
KeyName: "system.TTLBufferDays",
3635-
Description: "The number of buffer day in the TTL value",
3636-
DefaultValue: 15,
3637-
},
36383626
}
36393627

36403628
var BoolKeys = map[BoolKey]DynamicBool{

config/dynamicconfig/development.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ history.EnableConsistentQueryByDomain:
1010
system.enableExecutionTTL:
1111
- value: true
1212
constraints: {}
13-
system.TTLBufferDays:
14-
- value: 15
15-
constraints: {}
1613
history.enableCrossClusterOperations:
1714
- value: true
1815
constraints: {}

service/history/config/config.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,6 @@ type Config struct {
326326

327327
// HostName for machine running the service
328328
HostName string
329-
330-
//TTLBufferdays values for the TTL on workflows.
331-
TTLBufferDays dynamicconfig.IntPropertyFn
332329
}
333330

334331
// New returns new service config with default values
@@ -572,8 +569,7 @@ func New(dc *dynamicconfig.Collection, numberOfShards int, maxMessageSize int, s
572569
LargeShardHistoryEventMetricThreshold: dc.GetIntProperty(dynamicconfig.LargeShardHistoryEventMetricThreshold),
573570
LargeShardHistoryBlobMetricThreshold: dc.GetIntProperty(dynamicconfig.LargeShardHistoryBlobMetricThreshold),
574571

575-
HostName: hostname,
576-
TTLBufferDays: dc.GetIntProperty(dynamicconfig.TTLBufferDays),
572+
HostName: hostname,
577573
}
578574

579575
return cfg

service/history/execution/context.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import (
4545

4646
const (
4747
defaultRemoteCallTimeout = 30 * time.Second
48+
ttlBufferDays = 15
4849
dayToSecondMultiplier = 86400
4950
)
5051

service/history/execution/mutable_state_builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4823,7 +4823,7 @@ func (e *mutableStateBuilder) calculateTTL() (int, error) {
48234823
}
48244824
config := domainObj.GetConfig()
48254825
retention := time.Duration(config.Retention)
4826-
daysInSeconds := int(retention) + e.config.TTLBufferDays()*dayToSecondMultiplier
4826+
daysInSeconds := int((retention + ttlBufferDays) * dayToSecondMultiplier)
48274827
//Default state of TTL, means there is no TTL attached.
48284828
TTLInSeconds := 0
48294829
startTime := e.executionInfo.StartTimestamp

0 commit comments

Comments
 (0)