Skip to content

Commit

Permalink
INTMDB-874: Support transactionLifetimeLimitSeconds parameter in Clus…
Browse files Browse the repository at this point in the history
…ter and Advanced Cluser (#501)
  • Loading branch information
andreaangiolillo committed Jun 19, 2023
1 parent d69ad1a commit f7cb3b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions mongodbatlas/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ type ProcessArgs struct {
OplogSizeMB *int64 `json:"oplogSizeMB,omitempty"`
SampleSizeBIConnector *int64 `json:"sampleSizeBIConnector,omitempty"`
SampleRefreshIntervalBIConnector *int64 `json:"sampleRefreshIntervalBIConnector,omitempty"`
TransactionLifetimeLimitSeconds *int64 `json:"transactionLifetimeLimitSeconds,omitempty"`
OplogMinRetentionHours *float64 `json:"oplogMinRetentionHours,omitempty"`
}

Expand Down
9 changes: 7 additions & 2 deletions mongodbatlas/clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,7 @@ func TestClusters_UpdateProcessArgs(t *testing.T) {
OplogMinRetentionHours: pointer(100.0),
SampleSizeBIConnector: pointer(int64(5000)),
SampleRefreshIntervalBIConnector: pointer(int64(300)),
TransactionLifetimeLimitSeconds: pointer(int64(30)),
}

mux.HandleFunc(fmt.Sprintf("/api/atlas/v1.0/groups/%s/clusters/%s/processArgs", groupID, clusterName), func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -788,6 +789,7 @@ func TestClusters_UpdateProcessArgs(t *testing.T) {
"oplogMinRetentionHours": float64(100),
"sampleSizeBIConnector": float64(5000),
"sampleRefreshIntervalBIConnector": float64(300),
"transactionLifetimeLimitSeconds": float64(30),
}

jsonBlob := `
Expand All @@ -801,7 +803,8 @@ func TestClusters_UpdateProcessArgs(t *testing.T) {
"oplogSizeMB": 2000,
"oplogMinRetentionHours": 100,
"sampleSizeBIConnector": 5000,
"sampleRefreshIntervalBIConnector": 300
"sampleRefreshIntervalBIConnector": 300,
"transactionLifetimeLimitSeconds": 30
}
`

Expand Down Expand Up @@ -849,7 +852,8 @@ func TestClusters_GetProcessArgs(t *testing.T) {
"noTableScan": true,
"oplogSizeMB": 2000,
"sampleSizeBIConnector": 5000,
"sampleRefreshIntervalBIConnector": 300
"sampleRefreshIntervalBIConnector": 300,
"transactionLifetimeLimitSeconds": 30
}`)
})

Expand All @@ -868,6 +872,7 @@ func TestClusters_GetProcessArgs(t *testing.T) {
OplogSizeMB: pointer(int64(2000)),
SampleSizeBIConnector: pointer(int64(5000)),
SampleRefreshIntervalBIConnector: pointer(int64(300)),
TransactionLifetimeLimitSeconds: pointer(int64(30)),
}

if diff := deep.Equal(processArgs, expected); diff != nil {
Expand Down

0 comments on commit f7cb3b1

Please sign in to comment.