Skip to content

Commit e29fd33

Browse files
craig[bot]RaduBerindejeffswenson
committed
159633: storage: bump Pebble format r=RaduBerinde a=RaduBerinde Epic: none Release note: None 159645: importer: delete bulkio.import.write_import_epoch.enabled setting r=jeffswenson a=jeffswenson This is an internal setting that has been on by default for a few versions now. We need to delete it because setting it to false can cause data corruption if online restore restores a non epoch based import. Release note: none Fixes: #153999 Co-authored-by: Radu Berinde <radu@cockroachlabs.com> Co-authored-by: Jeff Swenson <jeffswenson@betterthannull.com>
3 parents 7220225 + 88cdd2c + 5a5d29d commit e29fd33

File tree

6 files changed

+11
-43
lines changed

6 files changed

+11
-43
lines changed

pkg/backup/testdata/backup-restore/import-epoch

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
new-cluster name=s1
66
----
77

8-
exec-sql
9-
SET CLUSTER SETTING bulkio.import.write_import_epoch.enabled=true;
10-
----
11-
128
exec-sql
139
CREATE DATABASE d;
1410
USE d;
@@ -88,20 +84,3 @@ query-sql
8884
SELECT * FROM import_epoch
8985
----
9086
3 <nil>
91-
92-
93-
exec-sql
94-
SET CLUSTER SETTING bulkio.import.write_import_epoch.enabled=false;
95-
----
96-
97-
# Ensure that the correct ImportType is set when the cluster setting is disabled
98-
import expect-pausepoint tag=b
99-
IMPORT INTO foo (i,s) CSV DATA ('nodelocal://1/export3/export*-n*.0.csv')
100-
----
101-
job paused at pausepoint
102-
103-
# We expect the zero-valued version here.
104-
query-sql
105-
SELECT * FROM import_epoch
106-
----
107-
3 <nil>

pkg/cli/testdata/ear-list

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ list
88
000004.log:
99
env type: Data, AES128_CTR
1010
keyID: bbb65a9d114c2a18740f27b6933b74f61018bd5adf545c153b48ffe6473336ef
11-
nonce: 86 a7 78 ad 4b da 62 56 d5 e2 d1 70
12-
counter: 798955289
11+
nonce: d0 b1 31 4b 08 b9 f6 08 7e e6 af 40
12+
counter: 2167389540
1313
000005.sst:
1414
env type: Data, AES128_CTR
1515
keyID: bbb65a9d114c2a18740f27b6933b74f61018bd5adf545c153b48ffe6473336ef
16-
nonce: d1 05 79 53 68 35 a0 f1 44 01 22 79
17-
counter: 1497766936
16+
nonce: 13 78 ef e7 4f 95 15 83 24 d8 1a 9d
17+
counter: 1330556971
1818
COCKROACHDB_DATA_KEYS_000001_monolith:
1919
env type: Store, AES128_CTR
2020
keyID: f594229216d81add7811c4360212eb7629b578ef4eab6e5d05679b3c5de48867
@@ -35,11 +35,11 @@ marker.datakeys.000001.COCKROACHDB_DATA_KEYS_000001_monolith:
3535
keyID: f594229216d81add7811c4360212eb7629b578ef4eab6e5d05679b3c5de48867
3636
nonce: 55 d7 d4 27 6c 97 9b dd f1 5d 40 c8
3737
counter: 467030050
38-
marker.format-version.000013.026:
38+
marker.format-version.000015.028:
3939
env type: Data, AES128_CTR
4040
keyID: bbb65a9d114c2a18740f27b6933b74f61018bd5adf545c153b48ffe6473336ef
41-
nonce: 23 d9 b2 e1 39 b0 87 ed f9 6d 49 20
42-
counter: 3481614039
41+
nonce: d1 05 79 53 68 35 a0 f1 44 01 22 79
42+
counter: 1497766936
4343
marker.manifest.000001.MANIFEST-000001:
4444
env type: Data, AES128_CTR
4545
keyID: bbb65a9d114c2a18740f27b6933b74f61018bd5adf545c153b48ffe6473336ef

pkg/settings/registry.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ var retiredSettings = map[InternalKey]struct{}{
276276
"storage.columnar_blocks.enabled": {},
277277

278278
// removed as of 26.1
279+
"bulkio.import.write_import_epoch.enabled": {},
279280
"sql.distsql_planning.use_gossip.enabled": {},
280281
"rocksdb.ingest_backpressure.l0_file_count_threshold": {},
281282
"rocksdb.ingest_backpressure.max_delay": {},

pkg/sql/importer/import_job.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,8 @@ func (r *importResumer) prepareTableForIngestion(
429429
// TODO(dt): audit everywhere we get table descs (leases or otherwise) to
430430
// ensure that filtering by state handles IMPORTING correctly.
431431

432-
// We only use the new OfflineForImport on 24.1, which bumps
433-
// the ImportEpoch, if we are completely on 24.1.
434-
if importEpochs.Get(&p.ExecCfg().Settings.SV) {
435-
importing.OfflineForImport()
436-
} else {
437-
importing.SetOffline(tabledesc.OfflineReasonImporting)
438-
}
432+
// Use OfflineForImport which bumps the ImportEpoch.
433+
importing.OfflineForImport()
439434

440435
// TODO(dt): de-validate all the FKs.
441436
if err := descsCol.WriteDesc(
@@ -709,13 +704,6 @@ var retryDuration = settings.RegisterDurationSetting(
709704
settings.PositiveDuration,
710705
)
711706

712-
var importEpochs = settings.RegisterBoolSetting(
713-
settings.ApplicationLevel,
714-
"bulkio.import.write_import_epoch.enabled",
715-
"controls whether IMPORT will write ImportEpoch's to descriptors",
716-
true,
717-
)
718-
719707
func getFractionCompleted(job *jobs.Job) float64 {
720708
p := job.Progress()
721709
return float64(p.GetFractionCompleted())

pkg/sql/importer/import_mvcc_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ func TestMVCCValueHeaderImportEpoch(t *testing.T) {
4848

4949
// Create a table where the first row ( in sort order) comes from an IMPORT
5050
// while the second comes from an INSERT.
51-
sqlDB.Exec(t, `SET CLUSTER SETTING bulkio.import.write_import_epoch.enabled=true`)
5251
sqlDB.Exec(t, `CREATE TABLE d.t (a INT8)`)
5352
sqlDB.Exec(t, `INSERT INTO d.t VALUES ('2')`)
5453
sqlDB.Exec(t, `IMPORT INTO d.t CSV DATA ($1)`, srv.URL)

pkg/storage/pebble.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2506,6 +2506,7 @@ func (p *Pebble) CreateCheckpoint(dir string, spans []roachpb.Span) error {
25062506
// named version, it can be assumed all *nodes* have ratcheted to the pebble
25072507
// version associated with it, since they did so during the fence version.
25082508
var pebbleFormatVersionMap = map[clusterversion.Key]pebble.FormatMajorVersion{
2509+
clusterversion.V26_1: pebble.FormatMarkForCompactionInVersionEdit,
25092510
clusterversion.V25_4: pebble.FormatV2BlobFiles,
25102511
}
25112512

0 commit comments

Comments
 (0)