Skip to content

Commit

Permalink
streamingccl: add show tenant without pts test
Browse files Browse the repository at this point in the history
This patch adds a test for the fix in cockroachdb#120434

Epic: none

Release note: none
  • Loading branch information
msbutler committed Mar 20, 2024
1 parent 51e269b commit 77196da
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/ccl/streamingccl/streamingest/stream_ingestion_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ func (s *streamIngestionResumer) handleResumeError(
func (s *streamIngestionResumer) Resume(ctx context.Context, execCtx interface{}) error {
// Protect the destination tenant's keyspan from garbage collection.
jobExecCtx := execCtx.(sql.JobExecContext)

if err := jobExecCtx.ExecCfg().JobRegistry.CheckPausepoint("stream_ingestion.before_protection"); err != nil {
return err
}
err := s.protectDestinationTenant(ctx, jobExecCtx)
if err != nil {
return s.handleResumeError(ctx, jobExecCtx, err)
Expand Down
19 changes: 19 additions & 0 deletions pkg/ccl/streamingccl/streamingest/testdata/show_without_pts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This test verifies that SHOW TENANT works even if a dest pts hasn't been set.

create-replication-clusters
----

exec-sql as=destination-system
SET CLUSTER SETTING jobs.debug.pausepoints = 'stream_ingestion.before_protection';
----

start-replication-stream
----

job as=destination-system wait-for-state=paused
----

query-sql as=destination-system
SELECT replicated_time FROM [SHOW VIRTUAL CLUSTER destination WITH REPLICATION STATUS];
----
<nil>

0 comments on commit 77196da

Please sign in to comment.