diff --git a/yb-voyager/cmd/importDataToSource.go b/yb-voyager/cmd/importDataToSource.go index fc2756695..91214f33a 100644 --- a/yb-voyager/cmd/importDataToSource.go +++ b/yb-voyager/cmd/importDataToSource.go @@ -98,7 +98,9 @@ func packAndSendImportDataToSourcePayload(status string, errorMsg string) { sourceDBDetails := callhome.SourceDBDetails{ DBType: tconf.TargetDBType, - DBVersion: targetDBDetails.DBVersion, + } + if targetDBDetails != nil { + sourceDBDetails.DBVersion = targetDBDetails.DBVersion } payload.SourceDBDetails = callhome.MarshalledJsonString(sourceDBDetails) @@ -112,7 +114,7 @@ func packAndSendImportDataToSourcePayload(status string, errorMsg string) { importDataPayload.Phase = importPhase - if importPhase != dbzm.MODE_SNAPSHOT { + if importPhase != dbzm.MODE_SNAPSHOT && statsReporter != nil { importDataPayload.EventsImportRate = statsReporter.EventsImportRateLast3Min importDataPayload.TotalImportedEvents = statsReporter.TotalEventsImported } diff --git a/yb-voyager/cmd/importDataToSourceReplica.go b/yb-voyager/cmd/importDataToSourceReplica.go index f8e93ac23..2a0402b84 100644 --- a/yb-voyager/cmd/importDataToSourceReplica.go +++ b/yb-voyager/cmd/importDataToSourceReplica.go @@ -100,9 +100,11 @@ func packAndSendImportDataToSrcReplicaPayload(status string, errorMsg string) { payload.MigrationType = LIVE_MIGRATION sourceDBDetails := callhome.SourceDBDetails{ - DBType: tconf.TargetDBType, - DBVersion: targetDBDetails.DBVersion, - Role: "replica", + DBType: tconf.TargetDBType, + Role: "replica", + } + if targetDBDetails != nil { + sourceDBDetails.DBVersion = targetDBDetails.DBVersion } payload.SourceDBDetails = callhome.MarshalledJsonString(sourceDBDetails) @@ -128,7 +130,7 @@ func packAndSendImportDataToSrcReplicaPayload(status string, errorMsg string) { importDataPayload.Phase = importPhase - if importPhase != dbzm.MODE_SNAPSHOT { + if importPhase != dbzm.MODE_SNAPSHOT && statsReporter != nil { importDataPayload.EventsImportRate = statsReporter.EventsImportRateLast3Min importDataPayload.TotalImportedEvents = statsReporter.TotalEventsImported }