Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdb07aac

Browse files
committed
Dynamically load librdmacm.so.1 version#2
1 parentb280a71 commitdb07aac

File tree

32 files changed

+392
-219
lines changed

32 files changed

+392
-219
lines changed

‎configure

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,7 @@ with_perl
722722
with_tcl
723723
enable_thread_safety
724724
INCLUDES
725+
with_rsocket
725726
autodepend
726727
TAS
727728
GCC
@@ -5305,6 +5306,8 @@ fi
53055306
#
53065307
# Replace socket with rsocket
53075308
#
5309+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with rsocket support" >&5
5310+
$as_echo_n "checking whether to build with rsocket support... " >&6; }
53085311

53095312

53105313

@@ -5331,10 +5334,9 @@ else
53315334
fi
53325335

53335336

5337+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_rsocket" >&5
5338+
$as_echo "$with_rsocket" >&6; }
53345339

5335-
if test "$with_rsocket" = yes ; then
5336-
LIBS="$LIBS -lrdmacm"
5337-
fi
53385340

53395341
#
53405342
# Include directories
@@ -12824,17 +12826,6 @@ fi
1282412826

1282512827
done
1282612828

12827-
fi
12828-
12829-
if test "$with_rsocket" = yes; then
12830-
ac_fn_c_check_header_mongrel "$LINENO" "rdma/rsocket.h" "ac_cv_header_rdma_rsocket_h" "$ac_includes_default"
12831-
if test "x$ac_cv_header_rdma_rsocket_h" = xyes; then :
12832-
12833-
else
12834-
as_fn_error $? "header file <rdma/rsocket.h> is required for RDMA API" "$LINENO" 5
12835-
fi
12836-
12837-
1283812829
fi
1283912830

1284012831
if test "$with_zlib" = yes; then

‎configure.in

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -577,13 +577,12 @@ PGAC_ARG_BOOL(enable, cassert, no, [enable assertion checks (for debugging)],
577577
#
578578
# Replace socket with rsocket
579579
#
580+
AC_MSG_CHECKING([whether to build with rsocket support])
580581
PGAC_ARG_BOOL(with, rsocket, no, [replace socket with rsocket (RDMA socket API)],
581582
[AC_DEFINE([WITH_RSOCKET], 1,
582583
[Define to 1 to build with rsocket instead socket. (--with-rsocket)])])
583-
584-
if test "$with_rsocket" = yes ; then
585-
LIBS="$LIBS -lrdmacm"
586-
fi
584+
AC_MSG_RESULT([$with_rsocket])
585+
AC_SUBST(with_rsocket)
587586

588587
#
589588
# Include directories
@@ -1389,10 +1388,6 @@ Use --without-readline to disable libedit support.])])])])
13891388
[AC_CHECK_HEADERS(readline/history.h)])])
13901389
fi
13911390

1392-
if test "$with_rsocket" = yes; then
1393-
AC_CHECK_HEADER(rdma/rsocket.h, [], [AC_MSG_ERROR([header file <rdma/rsocket.h> is required for RDMA API])])
1394-
fi
1395-
13961391
if test "$with_zlib" = yes; then
13971392
AC_CHECK_HEADER(zlib.h, [], [AC_MSG_ERROR([zlib header not found
13981393
If you have zlib already installed, see config.log for details on the

‎contrib/postgres_fdw/connection.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,7 @@ pgfdw_get_result(PGconn *conn, const char *query)
495495
/* Sleep until there's something to do */
496496
wc=WaitLatchOrSocket(MyLatch,
497497
WL_LATCH_SET |WL_SOCKET_READABLE,
498-
PQsocket(conn),
499-
#ifdefWITH_RSOCKET
500-
PQisRsocket(conn),
501-
#endif
498+
PQsocket(conn),PQisRsocket(conn),
502499
-1L);
503500
ResetLatch(MyLatch);
504501

‎src/Makefile.global.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ with_uuid= @with_uuid@
206206
with_zlib= @with_zlib@
207207
with_zstd = @with_zstd@
208208
with_icu= @with_icu@
209+
with_rsocket= @with_rsocket@
209210
enable_rpath= @enable_rpath@
210211
enable_nls= @enable_nls@
211212
enable_debug= @enable_debug@

‎src/backend/libpq/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include $(top_builddir)/src/Makefile.global
1515
# be-fsstubs is here for historical reasons, probably belongs elsewhere
1616

1717
OBJS = be-fsstubs.o be-secure.o auth.o crypt.o hba.o ip.o md5.o pqcomm.o\
18-
pqformat.o pqmq.o pqsignal.o auth-scram.o
18+
pqformat.o pqmq.o pqsignal.o auth-scram.o
1919

2020
ifeq ($(with_openssl),yes)
2121
OBJS += be-secure-openssl.o

‎src/backend/libpq/be-secure-openssl.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,7 @@ be_tls_open_server(Port *port)
423423
else
424424
waitfor=WL_SOCKET_WRITEABLE;
425425

426-
WaitLatchOrSocket(MyLatch,waitfor,port->sock,
427-
#ifdefWITH_RSOCKET
428-
port->isRsocket,
429-
#endif
426+
WaitLatchOrSocket(MyLatch,waitfor,port->sock,port->isRsocket,
430427
0);
431428
gotoaloop;
432429
caseSSL_ERROR_SYSCALL:

‎src/backend/libpq/pqcomm.c

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,7 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
477477
break;
478478
}
479479

480-
if ((fd=pg_socket(addr->ai_family,SOCK_STREAM,0, false))
481-
==PGINVALID_SOCKET)
480+
if ((fd=socket(addr->ai_family,SOCK_STREAM,0))==PGINVALID_SOCKET)
482481
{
483482
ereport(LOG,
484483
(errcode_for_socket_access(),
@@ -503,13 +502,13 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
503502
*/
504503
if (!IS_AF_UNIX(addr->ai_family))
505504
{
506-
if ((pg_setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,
507-
(char*)&one,sizeof(one), false))==-1)
505+
if ((setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,
506+
(char*)&one,sizeof(one)))==-1)
508507
{
509508
ereport(LOG,
510509
(errcode_for_socket_access(),
511510
errmsg("setsockopt(SO_REUSEADDR) failed: %m")));
512-
pg_closesocket(fd, false);
511+
closesocket(fd);
513512
continue;
514513
}
515514
}
@@ -518,13 +517,13 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
518517
#ifdefIPV6_V6ONLY
519518
if (addr->ai_family==AF_INET6)
520519
{
521-
if (pg_setsockopt(fd,IPPROTO_IPV6,IPV6_V6ONLY,
522-
(char*)&one,sizeof(one), false)==-1)
520+
if (setsockopt(fd,IPPROTO_IPV6,IPV6_V6ONLY,
521+
(char*)&one,sizeof(one))==-1)
523522
{
524523
ereport(LOG,
525524
(errcode_for_socket_access(),
526525
errmsg("setsockopt(IPV6_V6ONLY) failed: %m")));
527-
pg_closesocket(fd, false);
526+
closesocket(fd);
528527
continue;
529528
}
530529
}
@@ -536,7 +535,7 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
536535
* ipv4 addresses to ipv6. It will show ::ffff:ipv4 for all ipv4
537536
* connections.
538537
*/
539-
err=pg_bind(fd,addr->ai_addr,addr->ai_addrlen, false);
538+
err=bind(fd,addr->ai_addr,addr->ai_addrlen);
540539
if (err<0)
541540
{
542541
ereport(LOG,
@@ -551,7 +550,7 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
551550
errhint("Is another postmaster already running on port %d?"
552551
" If not, wait a few seconds and retry.",
553552
(int)portNumber)));
554-
pg_closesocket(fd, false);
553+
closesocket(fd);
555554
continue;
556555
}
557556

@@ -560,7 +559,7 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
560559
{
561560
if (Setup_AF_UNIX(service)!=STATUS_OK)
562561
{
563-
pg_closesocket(fd, false);
562+
closesocket(fd);
564563
break;
565564
}
566565
}
@@ -575,15 +574,15 @@ StreamServerPort(int family, char *hostName, unsigned short portNumber,
575574
if (maxconn>PG_SOMAXCONN)
576575
maxconn=PG_SOMAXCONN;
577576

578-
err=pg_listen(fd,maxconn, false);
577+
err=listen(fd,maxconn);
579578
if (err<0)
580579
{
581580
ereport(LOG,
582581
(errcode_for_socket_access(),
583582
/* translator: %s is IPv4, IPv6, or Unix */
584583
errmsg("could not listen on %s socket: %m",
585584
familyDesc)));
586-
pg_closesocket(fd, false);
585+
closesocket(fd);
587586
continue;
588587
}
589588
ListenSocket[listen_index]=fd;
@@ -713,9 +712,9 @@ StreamConnection(pgsocket server_fd, Port *port)
713712
{
714713
/* accept connection and fill in the client (remote) address */
715714
port->raddr.salen=sizeof(port->raddr.addr);
716-
if ((port->sock=pg_accept(server_fd,
717-
(structsockaddr*)&port->raddr.addr,
718-
&port->raddr.salen,port->isRsocket))==PGINVALID_SOCKET)
715+
if ((port->sock=accept(server_fd,
716+
(structsockaddr*)&port->raddr.addr,
717+
&port->raddr.salen))==PGINVALID_SOCKET)
719718
{
720719
ereport(LOG,
721720
(errcode_for_socket_access(),
@@ -744,9 +743,9 @@ StreamConnection(pgsocket server_fd, Port *port)
744743

745744
/* fill in the server (local) address */
746745
port->laddr.salen=sizeof(port->laddr.addr);
747-
if (pg_getsockname(port->sock,
748-
(structsockaddr*)&port->laddr.addr,
749-
&port->laddr.salen,port->isRsocket)<0)
746+
if (getsockname(port->sock,
747+
(structsockaddr*)&port->laddr.addr,
748+
&port->laddr.salen)<0)
750749
{
751750
elog(LOG,"getsockname() failed: %m");
752751
returnSTATUS_ERROR;
@@ -764,16 +763,16 @@ StreamConnection(pgsocket server_fd, Port *port)
764763

765764
#ifdefTCP_NODELAY
766765
on=1;
767-
if (pg_setsockopt(port->sock,IPPROTO_TCP,TCP_NODELAY,
768-
(char*)&on,sizeof(on),port->isRsocket)<0)
766+
if (setsockopt(port->sock,IPPROTO_TCP,TCP_NODELAY,
767+
(char*)&on,sizeof(on))<0)
769768
{
770769
elog(LOG,"setsockopt(TCP_NODELAY) failed: %m");
771770
returnSTATUS_ERROR;
772771
}
773772
#endif
774773
on=1;
775-
if (pg_setsockopt(port->sock,SOL_SOCKET,SO_KEEPALIVE,
776-
(char*)&on,sizeof(on),port->isRsocket)<0)
774+
if (setsockopt(port->sock,SOL_SOCKET,SO_KEEPALIVE,
775+
(char*)&on,sizeof(on))<0)
777776
{
778777
elog(LOG,"setsockopt(SO_KEEPALIVE) failed: %m");
779778
returnSTATUS_ERROR;
@@ -803,17 +802,17 @@ StreamConnection(pgsocket server_fd, Port *port)
803802
* https://msdn.microsoft.com/en-us/library/bb736549%28v=vs.85%29.aspx
804803
*/
805804
optlen=sizeof(oldopt);
806-
if (pg_getsockopt(port->sock,SOL_SOCKET,SO_SNDBUF, (char*)&oldopt,
807-
&optlen,port->isRsocket)<0)
805+
if (getsockopt(port->sock,SOL_SOCKET,SO_SNDBUF, (char*)&oldopt,
806+
&optlen)<0)
808807
{
809808
elog(LOG,"getsockopt(SO_SNDBUF) failed: %m");
810809
returnSTATUS_ERROR;
811810
}
812811
newopt=PQ_SEND_BUFFER_SIZE*4;
813812
if (oldopt<newopt)
814813
{
815-
if (pg_setsockopt(port->sock,SOL_SOCKET,SO_SNDBUF, (char*)&newopt,
816-
sizeof(newopt),port->isRsocket)<0)
814+
if (setsockopt(port->sock,SOL_SOCKET,SO_SNDBUF, (char*)&newopt,
815+
sizeof(newopt))<0)
817816
{
818817
elog(LOG,"setsockopt(SO_SNDBUF) failed: %m");
819818
returnSTATUS_ERROR;
@@ -847,9 +846,9 @@ StreamConnection(pgsocket server_fd, Port *port)
847846
* we do NOT want to send anything to the far end.
848847
*/
849848
void
850-
StreamClose(pgsocketsock,boolisRsocket)
849+
StreamClose(pgsocketsock)
851850
{
852-
pg_closesocket(sock,isRsocket);
851+
closesocket(sock);
853852
}
854853

855854
/*

‎src/backend/postmaster/pgstat.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3736,10 +3736,7 @@ PgstatCollectorMain(int argc, char *argv[])
37363736
#ifndefWIN32
37373737
wr=WaitLatchOrSocket(MyLatch,
37383738
WL_LATCH_SET |WL_POSTMASTER_DEATH |WL_SOCKET_READABLE,
3739-
pgStatSock,
3740-
#ifdefWITH_RSOCKET
3741-
false,
3742-
#endif
3739+
pgStatSock, false,
37433740
-1L);
37443741
#else
37453742

@@ -3755,7 +3752,7 @@ PgstatCollectorMain(int argc, char *argv[])
37553752
*/
37563753
wr=WaitLatchOrSocket(MyLatch,
37573754
WL_LATCH_SET |WL_POSTMASTER_DEATH |WL_SOCKET_READABLE |WL_TIMEOUT,
3758-
pgStatSock,
3755+
pgStatSock, false,
37593756
2*1000L/* msec */ );
37603757
#endif
37613758

‎src/backend/postmaster/postmaster.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ CloseServerPorts(int status, Datum arg)
14271427
{
14281428
if (ListenSocket[i]!=PGINVALID_SOCKET)
14291429
{
1430-
StreamClose(ListenSocket[i], false);
1430+
StreamClose(ListenSocket[i]);
14311431
ListenSocket[i]=PGINVALID_SOCKET;
14321432
#ifdefWITH_RSOCKET
14331433
ListenRdma[i]= false;
@@ -1757,8 +1757,7 @@ ServerLoop(void)
17571757

17581758
PG_SETMASK(&UnBlockSig);
17591759

1760-
/* Here all listened sockets are not rsockets, so pass 'false' */
1761-
selres=pg_select(nSockets,&rmask,NULL,NULL,&timeout, false);
1760+
selres=select(nSockets,&rmask,NULL,NULL,&timeout);
17621761

17631762
PG_SETMASK(&BlockSig);
17641763
}
@@ -1803,7 +1802,7 @@ ServerLoop(void)
18031802
* We no longer need the open socket or port structure
18041803
* in this process
18051804
*/
1806-
StreamClose(port->sock,port->isRsocket);
1805+
StreamClose(port->sock);
18071806
ConnFree(port);
18081807
}
18091808
}
@@ -2066,7 +2065,7 @@ ProcessStartupPacket(Port *port, bool SSLdone)
20662065
#endif
20672066

20682067
retry1:
2069-
if (pg_send(port->sock,&SSLok,1,0,port->isRsocket)!=1)
2068+
if (send(port->sock,&SSLok,1,0)!=1)
20702069
{
20712070
if (errno==EINTR)
20722071
gotoretry1;/* if interrupted, just retry */
@@ -2443,7 +2442,7 @@ ConnCreate(int serverFd)
24432442
if (StreamConnection(serverFd,port)!=STATUS_OK)
24442443
{
24452444
if (port->sock!=PGINVALID_SOCKET)
2446-
StreamClose(port->sock,port->isRsocket);
2445+
StreamClose(port->sock);
24472446
ConnFree(port);
24482447
returnNULL;
24492448
}
@@ -2517,7 +2516,7 @@ ClosePostmasterPorts(bool am_syslogger)
25172516
{
25182517
if (ListenSocket[i]!=PGINVALID_SOCKET)
25192518
{
2520-
StreamClose(ListenSocket[i], false);
2519+
StreamClose(ListenSocket[i]);
25212520
ListenSocket[i]=PGINVALID_SOCKET;
25222521
#ifdefWITH_RSOCKET
25232522
ListenRdma[i]= false;
@@ -4117,7 +4116,7 @@ report_fork_failure_to_client(Port *port, int errnum)
41174116
/* We'll retry after EINTR, but ignore all other failures */
41184117
do
41194118
{
4120-
rc=pg_send(port->sock,buffer,strlen(buffer)+1,0,port->isRsocket);
4119+
rc=send(port->sock,buffer,strlen(buffer)+1,0);
41214120
}while (rc<0&&errno==EINTR);
41224121
}
41234122

‎src/backend/postmaster/syslogger.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,7 @@ SysLoggerMain(int argc, char *argv[])
423423
#ifndefWIN32
424424
rc=WaitLatchOrSocket(MyLatch,
425425
WL_LATCH_SET |WL_SOCKET_READABLE |cur_flags,
426-
syslogPipe[0],
427-
#ifdefWITH_RSOCKET
428-
false,
429-
#endif
426+
syslogPipe[0], false,
430427
cur_timeout);
431428

432429
if (rc&WL_SOCKET_READABLE)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp