Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions pkg/ccl/backupccl/backup_metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/security/username"
"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/descs"
"github.com/cockroachdb/cockroach/pkg/sql/sqlutil"
"github.com/cockroachdb/cockroach/pkg/sql/stats"
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
Expand Down Expand Up @@ -88,7 +88,7 @@ func checkMetadata(
blobs.TestEmptyBlobClientFactory,
username.RootUserName(),
tc.Servers[0].InternalExecutor().(*sql.InternalExecutor),
tc.Servers[0].CollectionFactory().(*descs.CollectionFactory),
tc.Servers[0].InternalExecutorFactory().(sqlutil.InternalExecutorFactory),
tc.Servers[0].DB(),
nil, /* limiters */
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/ccl/backupccl/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ func TestBackupRestoreAppend(t *testing.T) {
blobs.TestEmptyBlobClientFactory,
username.RootUserName(),
tc.Servers[0].InternalExecutor().(*sql.InternalExecutor),
tc.Servers[0].CollectionFactory().(*descs.CollectionFactory),
tc.Servers[0].InternalExecutorFactory().(sqlutil.InternalExecutorFactory),
tc.Servers[0].DB(),
nil, /* limiters */
)
Expand Down Expand Up @@ -8027,7 +8027,7 @@ func TestReadBackupManifestMemoryMonitoring(t *testing.T) {
blobs.TestBlobServiceClient(dir),
username.RootUserName(),
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
nil, /* limiters */
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/backupccl/restore_data_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func runTestIngest(t *testing.T, init func(*cluster.Settings)) {
return cloud.MakeExternalStorage(ctx, dest, base.ExternalIODirConfig{},
s.ClusterSettings(), blobs.TestBlobServiceClient(s.ClusterSettings().ExternalIODir),
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
nil, /* limiters */
opts...)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/backupccl/restore_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -2216,7 +2216,7 @@ func (r *restoreResumer) OnFailOrCancel(
logJobCompletion(ctx, restoreJobEventType, r.job.ID(), false, jobErr)

execCfg := execCtx.(sql.JobExecContext).ExecCfg()
if err := execCfg.CollectionFactory.TxnWithExecutor(ctx, execCfg.DB, p.SessionData(), func(
if err := execCfg.InternalExecutorFactory.DescsTxnWithExecutor(ctx, execCfg.DB, p.SessionData(), func(
ctx context.Context, txn *kv.Txn, descsCol *descs.Collection, ie sqlutil.InternalExecutor,
) error {
for _, tenant := range details.Tenants {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/backupccl/restore_planning.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ func getDatabaseIDAndDesc(
// as regular databases, we drop them before restoring them again in the
// restore.
func dropDefaultUserDBs(ctx context.Context, execCfg *sql.ExecutorConfig) error {
return execCfg.CollectionFactory.TxnWithExecutor(ctx, execCfg.DB, nil /* session data */, func(
return execCfg.InternalExecutorFactory.DescsTxnWithExecutor(ctx, execCfg.DB, nil /* session data */, func(
ctx context.Context, txn *kv.Txn, _ *descs.Collection, ie sqlutil.InternalExecutor,
) error {
_, err := ie.Exec(ctx, "drop-defaultdb", txn, "DROP DATABASE IF EXISTS defaultdb")
Expand Down
26 changes: 14 additions & 12 deletions pkg/ccl/changefeedccl/schemafeed/schema_feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,16 @@ func New(
tolerances changefeedbase.CanHandle,
) SchemaFeed {
m := &schemaFeed{
filter: schemaChangeEventFilters[events],
db: cfg.DB,
clock: cfg.DB.Clock(),
settings: cfg.Settings,
targets: targets,
leaseMgr: cfg.LeaseManager.(*lease.Manager),
collectionFactory: cfg.CollectionFactory,
metrics: metrics,
tolerances: tolerances,
filter: schemaChangeEventFilters[events],
db: cfg.DB,
clock: cfg.DB.Clock(),
settings: cfg.Settings,
targets: targets,
leaseMgr: cfg.LeaseManager.(*lease.Manager),
collectionFactory: cfg.CollectionFactory,
internalExecutorFactory: cfg.InternalExecutorFactory,
metrics: metrics,
tolerances: tolerances,
}
m.mu.previousTableVersion = make(map[descpb.ID]catalog.TableDescriptor)
m.mu.highWater = initialHighwater
Expand Down Expand Up @@ -122,8 +123,9 @@ type schemaFeed struct {
// TODO(ajwerner): Should this live underneath the FilterFunc?
// Should there be another function to decide whether to update the
// lease manager?
leaseMgr *lease.Manager
collectionFactory *descs.CollectionFactory
leaseMgr *lease.Manager
collectionFactory *descs.CollectionFactory
internalExecutorFactory descs.TxnManager

mu struct {
syncutil.Mutex
Expand Down Expand Up @@ -291,7 +293,7 @@ func (tf *schemaFeed) primeInitialTableDescs(ctx context.Context) error {
})
}

if err := tf.collectionFactory.Txn(ctx, tf.db, initialTableDescsFn); err != nil {
if err := tf.internalExecutorFactory.DescsTxn(ctx, tf.db, initialTableDescsFn); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/changefeedccl/sink_cloudstorage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func TestCloudStorageSink(t *testing.T) {
clientFactory,
user,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
nil, /* limiters */
opts...)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/storageccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ go_test(
"//pkg/security/username",
"//pkg/server",
"//pkg/sql",
"//pkg/sql/catalog/descs",
"//pkg/sql/sqlutil",
"//pkg/storage",
"//pkg/testutils",
"//pkg/testutils/serverutils",
Expand Down
4 changes: 2 additions & 2 deletions pkg/ccl/storageccl/external_sst_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroachdb/cockroach/pkg/security/username"
"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/descs"
"github.com/cockroachdb/cockroach/pkg/sql/sqlutil"
"github.com/cockroachdb/cockroach/pkg/storage"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/testutils/storageutils"
Expand Down Expand Up @@ -124,7 +124,7 @@ func TestNewExternalSSTReader(t *testing.T) {
blobs.TestBlobServiceClient(tempDir),
username.RootUserName(),
tc.Servers[0].InternalExecutor().(*sql.InternalExecutor),
tc.Servers[0].CollectionFactory().(*descs.CollectionFactory),
tc.Servers[0].InternalExecutorFactory().(sqlutil.InternalExecutorFactory),
tc.Servers[0].DB(),
nil, /* limiters */
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/workloadccl/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func GetStorage(ctx context.Context, cfg FixtureConfig) (cloud.ExternalStorage,
nil, /* blobClientFactory */
username.SQLUsername{},
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
nil, /* limiters */
)
Expand Down
1 change: 0 additions & 1 deletion pkg/cloud/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ go_library(
"//pkg/security/username",
"//pkg/settings",
"//pkg/settings/cluster",
"//pkg/sql/catalog/descs",
"//pkg/sql/sqlutil",
"//pkg/util/ctxgroup",
"//pkg/util/ioctx",
Expand Down
34 changes: 19 additions & 15 deletions pkg/cloud/amazon/s3_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func makeS3Storage(
s, err := cloud.MakeExternalStorage(ctx, conf, base.ExternalIODirConfig{}, testSettings,
clientFactory,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
nil, /* limiters */
)
Expand Down Expand Up @@ -83,7 +83,7 @@ func TestPutS3(t *testing.T) {
"backup-test-default"), base.ExternalIODirConfig{}, testSettings,
blobs.TestEmptyBlobClientFactory, user,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
nil, /* limiters */
)
Expand Down Expand Up @@ -112,7 +112,7 @@ func TestPutS3(t *testing.T) {
cloud.AuthParam, cloud.AuthParamImplicit,
), false, user,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
testSettings)
})
Expand All @@ -122,11 +122,15 @@ func TestPutS3(t *testing.T) {
)
cloudtestutils.CheckExportStore(t, uri, false, user,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
testSettings,
)
cloudtestutils.CheckListFiles(t, uri, user, nil, nil, nil, testSettings)
cloudtestutils.CheckListFiles(t, uri, user,
nil, /* ie */
nil, /* ief */
nil, /* kvDB */
testSettings)
})

// Tests that we can put an object with server side encryption specified.
Expand All @@ -151,7 +155,7 @@ func TestPutS3(t *testing.T) {
false,
user,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
testSettings,
)
Expand All @@ -169,7 +173,7 @@ func TestPutS3(t *testing.T) {
false,
user,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
testSettings)
})
Expand Down Expand Up @@ -242,13 +246,13 @@ func TestPutS3AssumeRole(t *testing.T) {
)
cloudtestutils.CheckExportStore(t, uri, false, user,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
testSettings,
)
cloudtestutils.CheckListFiles(t, uri, user,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
testSettings,
)
Expand All @@ -260,13 +264,13 @@ func TestPutS3AssumeRole(t *testing.T) {
)
cloudtestutils.CheckExportStore(t, uri, false, user,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
testSettings,
)
cloudtestutils.CheckListFiles(t, uri, user,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
testSettings,
)
Expand Down Expand Up @@ -301,7 +305,7 @@ func TestPutS3AssumeRole(t *testing.T) {
)
cloudtestutils.CheckNoPermission(t, roleURI, user,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
testSettings,
)
Expand All @@ -321,7 +325,7 @@ func TestPutS3AssumeRole(t *testing.T) {

cloudtestutils.CheckExportStore(t, uri, false, user,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
testSettings,
)
Expand Down Expand Up @@ -365,7 +369,7 @@ func TestPutS3Endpoint(t *testing.T) {

cloudtestutils.CheckExportStore(t, u.String(), false, user,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
testSettings,
)
Expand Down Expand Up @@ -441,7 +445,7 @@ func TestS3BucketDoesNotExist(t *testing.T) {
s, err := cloud.MakeExternalStorage(ctx, conf, base.ExternalIODirConfig{}, testSettings,
clientFactory,
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
nil, /* limiters */
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud/azure/azure_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ func TestAzure(t *testing.T) {
cloudtestutils.CheckExportStore(t, cfg.filePath("backup-test"),
false, username.RootUserName(),
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
testSettings,
)
cloudtestutils.CheckListFiles(t, cfg.filePath("listing-test"), username.RootUserName(),
nil, /* ie */
nil, /* cf */
nil, /* ief */
nil, /* kvDB */
testSettings,
)
Expand Down
1 change: 0 additions & 1 deletion pkg/cloud/cloudtestutils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ go_library(
"//pkg/kv",
"//pkg/security/username",
"//pkg/settings/cluster",
"//pkg/sql/catalog/descs",
"//pkg/sql/sqlutil",
"//pkg/util/ioctx",
"//pkg/util/randutil",
Expand Down
Loading