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

APPS-1367 Add support for backup retention configuration #287

Merged
merged 28 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d7d0651
remove old style policy
korotkov-aerospike Dec 18, 2024
7b61590
add delete n function
korotkov-aerospike Dec 19, 2024
80a2549
add retnetion manager
korotkov-aerospike Dec 21, 2024
f022cd9
add retnetion manager
korotkov-aerospike Dec 21, 2024
a98ff05
update backened
korotkov-aerospike Dec 21, 2024
d2b9ac1
update backened
korotkov-aerospike Dec 21, 2024
d138ea4
update backened test
korotkov-aerospike Dec 21, 2024
b4cdd07
add test
korotkov-aerospike Dec 22, 2024
9d9d364
validation test
korotkov-aerospike Dec 22, 2024
a5a0733
update tests
korotkov-aerospike Dec 22, 2024
8098852
update tests
korotkov-aerospike Dec 22, 2024
78ef17e
linter
korotkov-aerospike Dec 22, 2024
7293259
update openapi
korotkov-aerospike Dec 22, 2024
1a1d0d6
revert find last
korotkov-aerospike Dec 22, 2024
190b6d4
update test
korotkov-aerospike Dec 22, 2024
f563748
revert comment
korotkov-aerospike Dec 22, 2024
2c22de6
Merge branch 'refs/heads/v2' into retention
korotkov-aerospike Dec 22, 2024
0d52e49
fix tags
korotkov-aerospike Dec 22, 2024
176e419
config
korotkov-aerospike Dec 22, 2024
3e23f9b
delete all at once
korotkov-aerospike Dec 22, 2024
0f78b66
update test
korotkov-aerospike Dec 22, 2024
01892e4
remove unused method
korotkov-aerospike Dec 22, 2024
3701871
use backup type
korotkov-aerospike Dec 23, 2024
b412d83
rename field
korotkov-aerospike Dec 23, 2024
dc59991
join errors
korotkov-aerospike Dec 23, 2024
cdec881
join errors
korotkov-aerospike Dec 23, 2024
061a832
add docs
korotkov-aerospike Dec 23, 2024
d559193
add docs
korotkov-aerospike Dec 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,30 @@ storage:
backup-policies:
keepFilesMaxRecordsPolicy:
parallel: 8
remove-files: KeepAll
sealed: true
retry-delay: 10_000
max-retries: 10
keepFilesPolicy:
parallel: 8
remove-files: KeepAll
sealed: true
removeFilesPolicy:
parallel: 8
remove-files: RemoveAll
sealed: true
retention:
full: 1
incremental: 0
removeIncrementalPolicy:
parallel: 8
remove-files: RemoveIncremental
sealed: true
retention:
incremental: 0
keepFilesPolicySlow:
parallel: 8
remove-files: KeepAll
bandwidth: 1
sealed: true
encryptedCompressedPolicy128:
parallel: 8
remove-files: RemoveAll
sealed: true
encryption:
key-file: encryptionKey
Expand All @@ -58,7 +58,6 @@ backup-policies:
mode: ZSTD
encryptedCompressedPolicy256:
parallel: 8
remove-files: RemoveAll
sealed: true
encryption:
key-file: encryptionKey
Expand All @@ -68,11 +67,9 @@ backup-policies:
mode: ZSTD
notSealed:
parallel: 8
remove-files: KeepAll
sealed: false
noIndexesUdfsRecords:
parallel: 8
remove-files: KeepAll
sealed: true
no-indexes: true
no-records: true
Expand Down
40 changes: 17 additions & 23 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1810,16 +1810,11 @@ const docTemplate = `{
"type": "integer",
"example": 1000
},
"remove-files": {
"description": "Whether to clear the output directory (default: KeepAll).",
"enum": [
"KeepAll",
"RemoveAll",
"RemoveIncremental"
],
"retention": {
"description": "Specifies how long to retain full and incremental backups.",
"allOf": [
{
"$ref": "#/definitions/dto.RemoveFilesType"
"$ref": "#/definitions/dto.RetentionPolicy"
}
]
},
Expand Down Expand Up @@ -1860,7 +1855,7 @@ const docTemplate = `{
"backup-policy": {
"description": "The name of the corresponding backup policy.",
"type": "string",
"example": "keepAll"
"example": "keepAllPolicy"
},
"bin-list": {
"description": "The list of backup bin names (optional, an empty list implies backing up all bins).",
Expand Down Expand Up @@ -2325,20 +2320,6 @@ const docTemplate = `{
}
}
},
"dto.RemoveFilesType": {
"description": "RemoveFilesType represents the type of the backup storage.",
"type": "string",
"enum": [
"KeepAll",
"RemoveAll",
"RemoveIncremental"
],
"x-enum-varnames": [
"KeepAll",
"RemoveAll",
"RemoveIncremental"
]
},
"dto.RestoreJobStatus": {
"description": "RestoreJobStatus represents a restore job status.",
"type": "object",
Expand Down Expand Up @@ -2627,6 +2608,19 @@ const docTemplate = `{
}
}
},
"dto.RetentionPolicy": {
"type": "object",
"properties": {
"full": {
"description": "Number of full backups to store:\n- If nil, retain all full backups.\n- If N is specified, retain the last N full backups.\n- The minimum value is 1.",
"type": "integer"
},
"incremental": {
"description": "Number of full backups to store incremental backups for:\n- If nil, retain all incremental backups.\n- If N is specified, retain incremental backups for the last N full backups.\n- If set to 0, do not retain any incremental backups.\n- Must not exceed the value of FullBackups.",
"type": "integer"
}
}
},
"dto.RetryPolicy": {
"description": "RetryPolicy defines the configuration for retry attempts in case of failures.",
"type": "object",
Expand Down
27 changes: 17 additions & 10 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2021,11 +2021,11 @@
"example" : 1000,
"type" : "integer"
},
"remove-files" : {
"retention" : {
"allOf" : [ {
"$ref" : "#/components/schemas/dto.RemoveFilesType"
"$ref" : "#/components/schemas/dto.RetentionPolicy"
} ],
"description" : "Whether to clear the output directory (default: KeepAll).",
"description" : "Specifies how long to retain full and incremental backups.",
"type" : "object"
},
"retry-policy" : {
Expand Down Expand Up @@ -2057,7 +2057,7 @@
"properties" : {
"backup-policy" : {
"description" : "The name of the corresponding backup policy.",
"example" : "keepAll",
"example" : "keepAllPolicy",
"type" : "string"
},
"bin-list" : {
Expand Down Expand Up @@ -2462,12 +2462,6 @@
},
"type" : "object"
},
"dto.RemoveFilesType" : {
"description" : "RemoveFilesType represents the type of the backup storage.",
"enum" : [ "KeepAll", "RemoveAll", "RemoveIncremental" ],
"type" : "string",
"x-enum-varnames" : [ "KeepAll", "RemoveAll", "RemoveIncremental" ]
},
"dto.RestoreJobStatus" : {
"description" : "RestoreJobStatus represents a restore job status.",
"properties" : {
Expand Down Expand Up @@ -2730,6 +2724,19 @@
"required" : [ "destination", "policy", "routine", "time" ],
"type" : "object"
},
"dto.RetentionPolicy" : {
"properties" : {
"full" : {
"description" : "Number of full backups to store:\n- If nil, retain all full backups.\n- If N is specified, retain the last N full backups.\n- The minimum value is 1.",
"type" : "integer"
},
"incremental" : {
"description" : "Number of full backups to store incremental backups for:\n- If nil, retain all incremental backups.\n- If N is specified, retain incremental backups for the last N full backups.\n- If set to 0, do not retain any incremental backups.\n- Must not exceed the value of FullBackups.",
"type" : "integer"
}
},
"type" : "object"
},
"dto.RetryPolicy" : {
"description" : "RetryPolicy defines the configuration for retry attempts in case of failures.",
"properties" : {
Expand Down
45 changes: 26 additions & 19 deletions docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,6 @@ components:
bandwidth: 10000
total-timeout: 2000
sealed: true
remove-files: "{}"
encryption: "{}"
parallel: 1
no-indexes: true
Expand All @@ -1429,6 +1428,7 @@ components:
file-limit: 1024
retry-policy: "{}"
socket-timeout: 1000
retention: "{}"
properties:
bandwidth:
description: |-
Expand Down Expand Up @@ -1471,10 +1471,10 @@ components:
the records-per-second limit is not applied.
example: 1000
type: integer
remove-files:
retention:
allOf:
- $ref: '#/components/schemas/dto.RemoveFilesType'
description: "Whether to clear the output directory (default: KeepAll)."
- $ref: '#/components/schemas/dto.RetentionPolicy'
description: Specifies how long to retain full and incremental backups.
type: object
retry-policy:
allOf:
Expand Down Expand Up @@ -1512,7 +1512,7 @@ components:
set-list:
- set1
interval-cron: 0 0 * * * *
backup-policy: keepAll
backup-policy: keepAllPolicy
node-list:
- "<IP addr 1>:<port 1>["
- "<IP addr 2>:<port 2>["
Expand All @@ -1527,7 +1527,7 @@ components:
properties:
backup-policy:
description: The name of the corresponding backup policy.
example: keepAll
example: keepAllPolicy
type: string
bin-list:
description: "The list of backup bin names (optional, an empty list implies\
Expand Down Expand Up @@ -1653,7 +1653,6 @@ components:
bandwidth: 10000
total-timeout: 2000
sealed: true
remove-files: "{}"
encryption: "{}"
parallel: 1
no-indexes: true
Expand All @@ -1662,6 +1661,7 @@ components:
file-limit: 1024
retry-policy: "{}"
socket-timeout: 1000
retention: "{}"
aerospike-clusters:
key:
credentials: "{}"
Expand Down Expand Up @@ -1704,7 +1704,7 @@ components:
set-list:
- set1
interval-cron: 0 0 * * * *
backup-policy: keepAll
backup-policy: keepAllPolicy
node-list:
- "<IP addr 1>:<port 1>["
- "<IP addr 2>:<port 2>["
Expand Down Expand Up @@ -1985,17 +1985,6 @@ components:
type: string
type: array
type: object
dto.RemoveFilesType:
description: RemoveFilesType represents the type of the backup storage.
enum:
- KeepAll
- RemoveAll
- RemoveIncremental
type: string
x-enum-varnames:
- KeepAll
- RemoveAll
- RemoveIncremental
dto.RestoreJobStatus:
description: RestoreJobStatus represents a restore job status.
example:
Expand Down Expand Up @@ -2261,6 +2250,24 @@ components:
- routine
- time
type: object
dto.RetentionPolicy:
properties:
full:
description: |-
Number of full backups to store:
- If nil, retain all full backups.
- If N is specified, retain the last N full backups.
- The minimum value is 1.
type: integer
incremental:
description: |-
Number of full backups to store incremental backups for:
- If nil, retain all incremental backups.
- If N is specified, retain incremental backups for the last N full backups.
- If set to 0, do not retain any incremental backups.
- Must not exceed the value of FullBackups.
type: integer
type: object
dto.RetryPolicy:
description: RetryPolicy defines the configuration for retry attempts in case
of failures.
Expand Down
2 changes: 0 additions & 2 deletions internal/server/handlers/config_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ const (

func testConfigBackupPolicy() *dto.BackupPolicy {
testInt := 10
keepFiles := dto.KeepAll
return &dto.BackupPolicy{
RemoveFiles: &keepFiles,
Parallel: &testInt,
SocketTimeout: &testInt,
TotalTimeout: &testInt,
Expand Down
Loading
Loading