Skip to content

Commit eb46297

Browse files
committed
backup: add deprecation warning for incremental_location
Epic: none Release note (ops change): the incremental_location option is now deprecated and will be removed in a future release. This feature was added so customers could define different TTL policies for incremental backups vs full backups. Users can still do this since incremental backups are by default stored in a distinct directory relative to full backups ({collection_root}/incrementals).
1 parent 76b08e5 commit eb46297

File tree

6 files changed

+14
-0
lines changed

6 files changed

+14
-0
lines changed

pkg/backup/backup_planning.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ const (
4949
deprecatedPrivilegesRestorePreamble = "The existing privileges are being deprecated " +
5050
"in favour of a fine-grained privilege model explained here " +
5151
"https://www.cockroachlabs.com/docs/stable/restore.html#required-privileges. In a future release, to run"
52+
53+
deprecatedIncrementalLocationMessage = "the incremental_location option is deprecated and will be removed in a future release"
5254
)
5355

5456
type tableAndIndex struct {
@@ -442,6 +444,10 @@ func backupPlanHook(
442444
return nil, nil, false, err
443445
}
444446

447+
if len(incrementalStorage) > 0 {
448+
p.BufferClientNotice(ctx, pgnotice.Newf(deprecatedIncrementalLocationMessage))
449+
}
450+
445451
var revisionHistory bool
446452
if backupStmt.Options.CaptureRevisionHistory != nil {
447453
revisionHistory, err = exprEval.Bool(

pkg/backup/create_scheduled_backup.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ func doCreateBackupSchedules(
339339

340340
var incDests []string
341341
if eval.incrementalStorage != nil {
342+
p.BufferClientNotice(ctx, pgnotice.Newf(deprecatedIncrementalLocationMessage))
342343
incDests = eval.incrementalStorage
343344
for _, incDest := range incDests {
344345
backupNode.Options.IncrementalStorage = append(backupNode.Options.IncrementalStorage, tree.NewStrVal(incDest))

pkg/backup/testdata/backup-restore/alter-schedule/backup-options

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ exec-sql
7474
alter backup schedule $incID set with encryption_passphrase = '';
7575
alter backup schedule $incID set with kms = ('aws:///key1?region=r1', 'aws:///key2?region=r2'), set with incremental_location = 'inc';
7676
----
77+
NOTICE: the incremental_location option is deprecated and will be removed in a future release
7778

7879
query-sql
7980
with schedules as (show schedules for backup) select command from schedules where label='datatest' order by backup_type asc;

pkg/backup/testdata/backup-restore/encrypted-backups

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ BACKUP INTO 'nodelocal://1/full' WITH encryption_passphrase='123';
1616
exec-sql
1717
BACKUP INTO 'nodelocal://1/full2' WITH encryption_passphrase='456', incremental_location='nodelocal://1/inc';
1818
----
19+
NOTICE: the incremental_location option is deprecated and will be removed in a future release
1920

2021
exec-sql
2122
BACKUP INTO 'nodelocal://1/full3' WITH kms='testkms:///cmk?AUTH=implicit';
@@ -92,6 +93,7 @@ BACKUP INTO LATEST IN 'nodelocal://1/full' WITH encryption_passphrase='123';
9293
exec-sql
9394
BACKUP INTO LATEST IN 'nodelocal://1/full2' WITH encryption_passphrase='456', incremental_location='nodelocal://1/inc';
9495
----
96+
NOTICE: the incremental_location option is deprecated and will be removed in a future release
9597

9698
exec-sql
9799
BACKUP INTO LATEST IN 'nodelocal://1/full3' WITH kms='testkms:///cmk?AUTH=implicit';

pkg/backup/testdata/backup-restore/external-connections-nodelocal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ BACKUP DATABASE d INTO 'external://full';
177177
exec-sql
178178
BACKUP DATABASE d INTO LATEST IN 'external://full' WITH incremental_location = 'external://inc';
179179
----
180+
NOTICE: the incremental_location option is deprecated and will be removed in a future release
180181

181182
query-sql
182183
SELECT object_name, object_type, backup_type FROM [SHOW BACKUP LATEST IN 'external://full' WITH
@@ -202,6 +203,7 @@ BACKUP DATABASE d INTO 'external://full/nested';
202203
exec-sql
203204
BACKUP DATABASE d INTO LATEST IN 'external://full/nested' WITH incremental_location = 'external://inc/nested';
204205
----
206+
NOTICE: the incremental_location option is deprecated and will be removed in a future release
205207

206208
query-sql
207209
SELECT object_name, object_type, backup_type FROM [SHOW BACKUP LATEST IN 'external://full/nested'

pkg/backup/testdata/backup-restore/external-connections-userfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ BACKUP DATABASE d INTO 'external://full';
156156
exec-sql
157157
BACKUP DATABASE d INTO LATEST IN 'external://full' WITH incremental_location = 'external://inc';
158158
----
159+
NOTICE: the incremental_location option is deprecated and will be removed in a future release
159160

160161
query-sql
161162
SELECT object_name, object_type, backup_type FROM [SHOW BACKUP LATEST IN 'external://full' WITH
@@ -181,6 +182,7 @@ BACKUP DATABASE d INTO 'external://full/nested';
181182
exec-sql
182183
BACKUP DATABASE d INTO LATEST IN 'external://full/nested' WITH incremental_location = 'external://inc/nested';
183184
----
185+
NOTICE: the incremental_location option is deprecated and will be removed in a future release
184186

185187
query-sql
186188
SELECT object_name, object_type, backup_type FROM [SHOW BACKUP LATEST IN 'external://full/nested'

0 commit comments

Comments
 (0)