Skip to content

Commit 1e9518a

Browse files
committed
fix: improve hostname resolution error handling in getSegmentIpAddress #24
1 parent f4bf467 commit 1e9518a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

utils/wrappers.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,11 @@ func getSegmentIpAddress(conn *dbconn.DBConn, timestamp string, segId int, segHo
7575
err = conn.Select(&results, query)
7676
gplog.FatalOnError(err, fmt.Sprintf("Query was: %s", query))
7777

78-
if len(results) != 1 {
79-
gplog.FatalOnError(errors.Errorf("Dest segment \"%v\" should return only one IP address", segHost),
78+
if len(results) == 0 {
79+
gplog.FatalOnError(
80+
errors.Errorf("Unable to resolve segment hostname \"%v\" to IP address on coordinator. "+
81+
"Please verify that the hostname field in gp_segment_configuration table contains valid hostnames "+
82+
"that can be resolved to IP addresses on the coordinator", segHost),
8083
fmt.Sprintf("Query was: %s", query))
8184
}
8285

0 commit comments

Comments
 (0)