Skip to content

Commit

Permalink
bulkio: Avoid using AssertionFailed error when planning replication.
Browse files Browse the repository at this point in the history
AssertionFailed error message is not appropriate.
Return "unsupported error" instead.

Release Notes: None
  • Loading branch information
Yevgeniy Miretskiy committed Feb 22, 2021
1 parent 64c4aef commit dd83317
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion pkg/ccl/streamingccl/streamproducer/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ go_library(
"//pkg/sql/sem/tree",
"//pkg/sql/types",
"//pkg/util/hlc",
"@com_github_cockroachdb_errors//:errors",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
"github.com/cockroachdb/cockroach/pkg/sql/types"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
"github.com/cockroachdb/errors"
)

// replicationStreamEval is a representation of tree.ReplicationStream, prepared
Expand Down Expand Up @@ -128,7 +127,7 @@ func doCreateReplicationStream(

if sinkURI != "" {
// TODO(yevgeniy): Support replication stream sinks.
return errors.AssertionFailedf("replication streaming into sink not supported")
return pgerror.New(pgcode.FeatureNotSupported, "replication streaming into sink not supported")
}

var scanStart hlc.Timestamp
Expand All @@ -141,7 +140,7 @@ func doCreateReplicationStream(
var spans []roachpb.Span
if eval.Targets.Tenant == (roachpb.TenantID{}) {
// TODO(yevgeniy): Only tenant streaming supported now; Support granular streaming.
return errors.AssertionFailedf("granular replication streaming not supported")
return pgerror.New(pgcode.FeatureNotSupported, "granular replication streaming not supported")
}

telemetry.Count(`replication.create.tenant`)
Expand Down

0 comments on commit dd83317

Please sign in to comment.