Skip to content

Commit adc090a

Browse files
tanjinxClaude
andcommitted
Handle NULL options column in vreplication readers
The options column was changed to DEFAULT NULL, so existing rows or rows without an explicit options value can have NULL. This caused JSON parse failures ("unexpected end of JSON input") since NULL becomes an empty string. Fall back to "{}" when empty. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com>
1 parent 612e2cf commit adc090a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

go/vt/binlog/binlogplayer/binlog_player.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,9 @@ func ReadVRSettings(dbClient DBClient, uid int32) (VRSettings, error) {
612612
return VRSettings{}, fmt.Errorf("failed to parse defer_secondary_keys column: %v", err)
613613
}
614614
options := vrRow.AsString("options", "{}")
615+
if options == "" {
616+
options = "{}"
617+
}
615618
var workflowOptions vtctldata.WorkflowOptions
616619
if err := json.Unmarshal([]byte(options), &workflowOptions); err != nil {
617620
return VRSettings{}, fmt.Errorf("failed to parse options column: %v", err)

go/vt/vttablet/tabletmanager/vreplication/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ type controller struct {
7979

8080
func processWorkflowOptions(params map[string]string) (*vttablet.VReplicationConfig, error) {
8181
options, ok := params["options"]
82-
if !ok {
82+
if !ok || options == "" {
8383
options = "{}"
8484
}
8585
var workflowOptions vtctldata.WorkflowOptions

0 commit comments

Comments
 (0)