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

Commitf7741da

Browse files
committed
Dynamically load librdmacm.so.1. Changes to backend and frontend
1 parent8229d85 commitf7741da

30 files changed

+618
-228
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

‎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/auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ auth_peer(hbaPort *port)
18341834
gid_tgid;
18351835
structpasswd*pw;
18361836

1837-
if (getpeereid(port->sock,&uid,&gid)!=0)
1837+
if (getpeereid(PG_SOCK(port->sock),&uid,&gid)!=0)
18381838
{
18391839
/* Provide special error message if getpeereid is a stub */
18401840
if (errno==ENOSYS)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ be_tls_open_server(Port *port)
423423
else
424424
waitfor=WL_SOCKET_WRITEABLE;
425425

426-
WaitLatchOrSocket(MyLatch,waitfor,port->sock,
426+
WaitLatchOrSocket(MyLatch,waitfor,PG_SOCK(port->sock),
427427
#ifdefWITH_RSOCKET
428-
port->isRsocket,
428+
PG_ISRSOCKET(port->isRsocket),
429429
#endif
430430
0);
431431
gotoaloop;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ secure_raw_read(Port *port, void *ptr, size_t len)
208208
#ifdefWIN32
209209
pgwin32_noblock= true;
210210
#endif
211-
n=pg_recv(port->sock,ptr,len,0,port->isRsocket);
211+
n=pg_recv(port->sock,ptr,len,0);
212212
#ifdefWIN32
213213
pgwin32_noblock= false;
214214
#endif
@@ -289,7 +289,7 @@ secure_raw_write(Port *port, const void *ptr, size_t len)
289289
#ifdefWIN32
290290
pgwin32_noblock= true;
291291
#endif
292-
n=pg_send(port->sock,ptr,len,0,port->isRsocket);
292+
n=pg_send(port->sock,ptr,len,0);
293293
#ifdefWIN32
294294
pgwin32_noblock= false;
295295
#endif

‎src/backend/libpq/pqcomm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
#include<grp.h>
7474
#include<unistd.h>
7575
#include<sys/file.h>
76+
#include<sys/socket.h>
7677
#include<sys/stat.h>
7778
#include<sys/time.h>
7879
#include<netdb.h>
@@ -91,7 +92,6 @@
9192
#include"libpq/ip.h"
9293
#include"libpq/libpq.h"
9394
#include"miscadmin.h"
94-
#include"pg_socket.h"
9595
#include"storage/ipc.h"
9696
#include"utils/guc.h"
9797
#include"utils/memutils.h"

‎src/backend/postmaster/pgstat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ pgstat_init(void)
543543
* falls behind, statistics messages will be discarded; backends won't
544544
* block waiting to send messages to the collector.
545545
*/
546-
if (!pg_set_noblock(pgStatSock, false))
546+
if (!pg_set_noblock(pgStatSock))
547547
{
548548
ereport(LOG,
549549
(errcode_for_socket_access(),

‎src/backend/postmaster/postmaster.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
#include<sys/wait.h>
7272
#include<ctype.h>
7373
#include<sys/stat.h>
74+
#include<sys/socket.h>
7475
#include<fcntl.h>
7576
#include<sys/param.h>
7677
#include<netinet/in.h>
@@ -1427,7 +1428,7 @@ CloseServerPorts(int status, Datum arg)
14271428
{
14281429
if (ListenSocket[i]!=PGINVALID_SOCKET)
14291430
{
1430-
StreamClose(ListenSocket[i], false);
1431+
StreamClose(ListenSocket[i]);
14311432
ListenSocket[i]=PGINVALID_SOCKET;
14321433
#ifdefWITH_RSOCKET
14331434
ListenRdma[i]= false;
@@ -1758,7 +1759,7 @@ ServerLoop(void)
17581759
PG_SETMASK(&UnBlockSig);
17591760

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

17631764
PG_SETMASK(&BlockSig);
17641765
}
@@ -1803,7 +1804,7 @@ ServerLoop(void)
18031804
* We no longer need the open socket or port structure
18041805
* in this process
18051806
*/
1806-
StreamClose(port->sock,port->isRsocket);
1807+
StreamCloseExtended(port->sock);
18071808
ConnFree(port);
18081809
}
18091810
}
@@ -2066,7 +2067,7 @@ ProcessStartupPacket(Port *port, bool SSLdone)
20662067
#endif
20672068

20682069
retry1:
2069-
if (pg_send(port->sock,&SSLok,1,0,port->isRsocket)!=1)
2070+
if (pg_send(port->sock,&SSLok,1,0)!=1)
20702071
{
20712072
if (errno==EINTR)
20722073
gotoretry1;/* if interrupted, just retry */
@@ -2435,15 +2436,13 @@ ConnCreate(int serverFd)
24352436
ExitPostmaster(1);
24362437
}
24372438

2438-
port->isRsocket= false;
24392439
#ifdefWITH_RSOCKET
24402440
port->with_rsocket= false;
24412441
#endif
24422442

24432443
if (StreamConnection(serverFd,port)!=STATUS_OK)
24442444
{
2445-
if (port->sock!=PGINVALID_SOCKET)
2446-
StreamClose(port->sock,port->isRsocket);
2445+
StreamCloseExtended(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;
@@ -4068,7 +4067,7 @@ BackendStartup(Port *port)
40684067
/* in parent, successful fork */
40694068
ereport(DEBUG2,
40704069
(errmsg_internal("forked new backend, pid=%d socket=%d",
4071-
(int)pid, (int)port->sock)));
4070+
(int)pid, (int)PG_SOCK(port->sock))));
40724071

40734072
#ifdefWITH_RSOCKET
40744073
/* Increment rsocket port number for next connection */
@@ -4111,13 +4110,13 @@ report_fork_failure_to_client(Port *port, int errnum)
41114110
strerror(errnum));
41124111

41134112
/* Set port to non-blocking. Don't do send() if this fails */
4114-
if (!pg_set_noblock(port->sock,port->isRsocket))
4113+
if (!pg_set_noblock_extended(port->sock))
41154114
return;
41164115

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=pg_send(port->sock,buffer,strlen(buffer)+1,0);
41214120
}while (rc<0&&errno==EINTR);
41224121
}
41234122

‎src/backend/replication/walsender.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,9 +1145,9 @@ WalSndWriteData(LogicalDecodingContext *ctx, XLogRecPtr lsn, TransactionId xid,
11451145

11461146
/* Sleep until something happens or we time out */
11471147
WaitLatchOrSocket(MyLatch,wakeEvents,
1148-
MyProcPort->sock,
1148+
PG_SOCK(MyProcPort->sock),
11491149
#ifdefWITH_RSOCKET
1150-
MyProcPort->isRsocket,
1150+
PG_ISRSOCKET(MyProcPort->sock),
11511151
#endif
11521152
sleeptime);
11531153
}
@@ -1278,9 +1278,9 @@ WalSndWaitForWal(XLogRecPtr loc)
12781278

12791279
/* Sleep until something happens or we time out */
12801280
WaitLatchOrSocket(MyLatch,wakeEvents,
1281-
MyProcPort->sock,
1281+
PG_SOCK(MyProcPort->sock),
12821282
#ifdefWITH_RSOCKET
1283-
MyProcPort->isRsocket,
1283+
PG_ISRSOCKET(MyProcPort->sock),
12841284
#endif
12851285
sleeptime);
12861286
}
@@ -1903,9 +1903,9 @@ WalSndLoop(WalSndSendDataCallback send_data)
19031903

19041904
/* Sleep until something happens or we time out */
19051905
WaitLatchOrSocket(MyLatch,wakeEvents,
1906-
MyProcPort->sock,
1906+
PG_SOCK(MyProcPort->sock),
19071907
#ifdefWITH_RSOCKET
1908-
MyProcPort->isRsocket,
1908+
PG_ISRSOCKET(MyProcPort->sock),
19091909
#endif
19101910
sleeptime);
19111911
}

‎src/backend/storage/file/fd.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,9 +2134,9 @@ FileSeek(File file, off_t offset, int whence)
21342134
vfdP->seekPos+=offset;
21352135
break;
21362136
caseSEEK_END:
2137-
returnCode=FileAccess(file);
2138-
if (returnCode<0)
2139-
returnreturnCode;
2137+
returnCode=FileAccess(file);
2138+
if (returnCode<0)
2139+
returnreturnCode;
21402140

21412141
if (VfdCache[file].fileFlags&PG_COMPRESSION)
21422142
{
@@ -2147,10 +2147,10 @@ FileSeek(File file, off_t offset, int whence)
21472147
offset=fileSize;
21482148

21492149
VfdCache[file].seekPos=fileSize-offset;
2150-
}
2151-
else
2152-
if (FileAccess(file)<0)
2153-
return (off_t)-1;
2150+
}
2151+
else
2152+
if (FileAccess(file)<0)
2153+
return (off_t)-1;
21542154
vfdP->seekPos=lseek(vfdP->fd,offset,whence);
21552155

21562156
break;

‎src/backend/storage/ipc/latch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,8 +1751,8 @@ WaitEventSetWaitBlockForRsocket(WaitEventSet *set, int cur_timeout,
17511751
WaitEvent*cur_event;
17521752
structpollfd*cur_pollfd;
17531753

1754-
/* Sleep */
1755-
rc=pg_poll(set->rpollfds,set->nevents, (int)cur_timeout, true);
1754+
/* Sleepusing rpoll() from pg_socket.h*/
1755+
rc=rpoll(set->rpollfds,set->nevents, (int)cur_timeout);
17561756

17571757
/* Check return code */
17581758
if (rc<0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp