@@ -3601,10 +3601,10 @@ RsocketInitialize(Port *port)
3601
3601
struct addrinfo * addr = NULL ,
3602
3602
hint ;
3603
3603
union {
3604
- struct sockaddr addr ;
3605
- struct sockaddr_in addr_in ;
3606
- struct sockaddr_in6 addr_in6 ;
3607
- } sa ;
3604
+ struct sockaddr addr ;
3605
+ struct sockaddr_in addr_in ;
3606
+ struct sockaddr_in6 addr_in6 ;
3607
+ } sa ;
3608
3608
socklen_t saddrlen ;
3609
3609
3610
3610
struct sockaddr_in * addr_in ;
@@ -3623,7 +3623,7 @@ RsocketInitialize(Port *port)
3623
3623
/* It is necessary to dynamically load librdmacm at first call */
3624
3624
initialize_rsocket ();
3625
3625
3626
- retry2 :
3626
+ retry2 :
3627
3627
switch (port -> laddr .addr .ss_family )
3628
3628
{
3629
3629
case AF_INET :
@@ -3643,20 +3643,20 @@ RsocketInitialize(Port *port)
3643
3643
(errmsg ("unrecognized address family %d" ,
3644
3644
port -> laddr .addr .ss_family )));
3645
3645
}
3646
-
3646
+
3647
3647
MemSet (& hint , 0 , sizeof (hint ));
3648
3648
hint .ai_family = port -> laddr .addr .ss_family ;
3649
3649
hint .ai_flags = AI_NUMERICHOST ;
3650
3650
hint .ai_socktype = SOCK_STREAM ;
3651
-
3651
+
3652
3652
ret = pg_getaddrinfo_all (local_host , NULL , & hint , & addr );
3653
3653
if (ret || !addr )
3654
3654
{
3655
3655
if (addr )
3656
3656
pg_freeaddrinfo_all (hint .ai_family , addr );
3657
3657
ereport (FATAL ,
3658
- (errmsg ("could not translate host name \"%s\", service \"%s\" to address : %s" ,
3659
- local_host , local_port , gai_strerror (ret ))));
3658
+ (errmsg ("could not get address info for service \"%s\": %s" ,
3659
+ local_host , gai_strerror (ret ))));
3660
3660
}
3661
3661
3662
3662
if ((fd = pg_socket (addr -> ai_family , SOCK_STREAM , 0 , true))
@@ -3720,11 +3720,10 @@ RsocketInitialize(Port *port)
3720
3720
3721
3721
ereport (FATAL ,
3722
3722
(errcode_for_socket_access (),
3723
- errmsg ("could not bind socket: %m" ),
3724
- errhint ("Is another postmaster already running on port %s?"
3725
- " If not, wait a few seconds and retry." ,
3726
- local_port )));
3723
+ errmsg ("could not bind RDMA socket: %m" )));
3727
3724
}
3725
+ pg_freeaddrinfo_all (hint .ai_family , addr );
3726
+
3728
3727
saddrlen = sizeof (sa );
3729
3728
ret = pg_getsockname (fd , & sa .addr , & saddrlen , true);
3730
3729
if (ret < 0 )
@@ -3737,7 +3736,6 @@ RsocketInitialize(Port *port)
3737
3736
ereport (FATAL ,
3738
3737
(errcode_for_socket_access (),
3739
3738
errmsg ("could not get name info: %m" )));
3740
- pg_freeaddrinfo_all (hint .ai_family , addr );
3741
3739
3742
3740
elog (DEBUG1 , "Assign port %s to RDMA socket" , local_port );
3743
3741
0 commit comments