Skip to content

Commit

Permalink
changefeedccl: correctly populate InitialScan field for structured logs
Browse files Browse the repository at this point in the history
This patch fixes the logic for populating the `InitialScan` field in
changefeed structured log events to correctly reflect that the default
value when no initial scan options are specified is 'yes'.

Release note: None
  • Loading branch information
andyyang890 committed Nov 12, 2024
1 parent 82d8508 commit f7b7031
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/ccl/changefeedccl/changefeed_stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -1572,13 +1572,11 @@ func makeCommonChangefeedEventDetails(
sinkType = parsedSink.Scheme
}

var initialScan string
initialScanType, initialScanSet := opts[changefeedbase.OptInitialScan]
_, initialScanOnlySet := opts[changefeedbase.OptInitialScanOnly]
_, noInitialScanSet := opts[changefeedbase.OptNoInitialScan]
if initialScanSet && initialScanType == `` {
initialScan = `yes`
} else if initialScanSet && initialScanType != `` {
initialScan := `yes`
if initialScanSet && initialScanType != `` {
initialScan = initialScanType
} else if initialScanOnlySet {
initialScan = `only`
Expand Down

0 comments on commit f7b7031

Please sign in to comment.