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

Commit73b3bd5

Browse files
committed
Document the existence of the socket lock file under unix_socket_directory,
which is perhaps not a terribly good spot for it but there doesn't seem to bea better place. Also add a source-code comment pointing out a couple reasonsfor having a separate lock file. Per suggestion from Greg Smith.
1 parent4832291 commit73b3bd5

File tree

2 files changed

+64
-33
lines changed

2 files changed

+64
-33
lines changed

‎doc/src/sgml/config.sgml

Lines changed: 58 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.308 2010/08/24 13:32:25 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.309 2010/08/26 22:00:19 tgl Exp $ -->
22

33
<chapter Id="runtime-config">
44
<title>Server Configuration</title>
@@ -426,6 +426,20 @@ SET ENABLE_SEQSCAN TO OFF;
426426
<filename>/tmp</filename>, but can be changed at build time.
427427
This parameter can only be set at server start.
428428
</para>
429+
430+
<para>
431+
In addition to the socket file itself, which is named
432+
<literal>.s.PGSQL.<replaceable>nnnn</></literal> where
433+
<replaceable>nnnn</> is the server's port number, an ordinary file
434+
named <literal>.s.PGSQL.<replaceable>nnnn</>.lock</literal> will be
435+
created in the <varname>unix_socket_directory</> directory. Neither
436+
file should ever be removed manually.
437+
</para>
438+
439+
<para>
440+
This parameter is irrelevant on Windows, which does not have
441+
Unix-domain sockets.
442+
</para>
429443
</listitem>
430444
</varlistentry>
431445

@@ -445,6 +459,11 @@ SET ENABLE_SEQSCAN TO OFF;
445459
group of the server user. This parameter can only be set at
446460
server start.
447461
</para>
462+
463+
<para>
464+
This parameter is irrelevant on Windows, which does not have
465+
Unix-domain sockets.
466+
</para>
448467
</listitem>
449468
</varlistentry>
450469

@@ -482,6 +501,11 @@ SET ENABLE_SEQSCAN TO OFF;
482501
<para>
483502
This parameter can only be set at server start.
484503
</para>
504+
505+
<para>
506+
This parameter is irrelevant on Windows, which does not have
507+
Unix-domain sockets.
508+
</para>
485509
</listitem>
486510
</varlistentry>
487511

@@ -523,18 +547,19 @@ SET ENABLE_SEQSCAN TO OFF;
523547
</indexterm>
524548
<listitem>
525549
<para>
526-
Specifies the number of seconds before sending a keepalive packet on an otherwise idle
527-
connection. A value of 0 uses the system default. This parameter is supported
528-
only on systems that support the <symbol>TCP_KEEPIDLE</> or <symbol>TCP_KEEPALIVE</>
529-
symbols, and on Windows; on other systems, it must be zero. This parameter is
530-
ignored for connections made via a Unix-domain socket.
531-
<note>
532-
<para>
533-
On Windows, a value of 0 will set this parameter to 2 hours,
534-
since Windows does not provide a way to read the default value.
535-
</para>
536-
</note>
550+
Specifies the number of seconds before sending a keepalive packet on
551+
an otherwise idle connection. A value of 0 uses the system default.
552+
This parameter is supported only on systems that support the
553+
<symbol>TCP_KEEPIDLE</> or <symbol>TCP_KEEPALIVE</> symbols, and on
554+
Windows; on other systems, it must be zero. This parameter is ignored
555+
for connections made via a Unix-domain socket.
537556
</para>
557+
<note>
558+
<para>
559+
On Windows, a value of 0 will set this parameter to 2 hours,
560+
since Windows does not provide a way to read the system default value.
561+
</para>
562+
</note>
538563
</listitem>
539564
</varlistentry>
540565

@@ -545,18 +570,19 @@ SET ENABLE_SEQSCAN TO OFF;
545570
</indexterm>
546571
<listitem>
547572
<para>
548-
Specifies the number of seconds between sending keepalives on an otherwise idle
549-
connection. A value of 0 uses the system default. This parameter is supported
550-
only on systems that support the <symbol>TCP_KEEPINTVL</>
551-
symbol, and on Windows; on other systems, it must be zero. This parameter is
552-
ignored for connections made via a Unix-domain socket.
553-
<note>
554-
<para>
555-
On Windows, a value of 0 will set this parameter to 1 second,
556-
since Windows does not provide a way to read the default value.
557-
</para>
558-
</note>
573+
Specifies the number of seconds between sending keepalives on an
574+
otherwise idle connection. A value of 0 uses the system default.
575+
This parameter is supported only on systems that support the
576+
<symbol>TCP_KEEPINTVL</> symbol, and on Windows; on other systems, it
577+
must be zero. This parameter is ignored for connections made via a
578+
Unix-domain socket.
559579
</para>
580+
<note>
581+
<para>
582+
On Windows, a value of 0 will set this parameter to 1 second,
583+
since Windows does not provide a way to read the system default value.
584+
</para>
585+
</note>
560586
</listitem>
561587
</varlistentry>
562588

@@ -568,16 +594,16 @@ SET ENABLE_SEQSCAN TO OFF;
568594
<listitem>
569595
<para>
570596
Specifies the number of keepalive packets to send on an otherwise idle
571-
connection. A value of 0 uses the system default. This parameter is supported
572-
only on systems that support the <symbol>TCP_KEEPCNT</>
573-
symbol; on other systems, it must be zero. This parameter is
574-
ignored for connections made via a Unix-domain socket.
575-
<note>
576-
<para>
577-
This parameter is not supported on Windows, and must be zero.
578-
</para>
579-
</note>
597+
connection. A value of 0 uses the system default. This parameter is
598+
supported only on systems that support the <symbol>TCP_KEEPCNT</>
599+
symbol; on other systems, it must be zero. This parameter is ignored
600+
for connections made via a Unix-domain socket.
580601
</para>
602+
<note>
603+
<para>
604+
This parameter is not supported on Windows, and must be zero.
605+
</para>
606+
</note>
581607
</listitem>
582608
</varlistentry>
583609

‎src/backend/libpq/pqcomm.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
3131
* Portions Copyright (c) 1994, Regents of the University of California
3232
*
33-
*$PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.212 2010/07/08 16:19:50 mha Exp $
33+
*$PostgreSQL: pgsql/src/backend/libpq/pqcomm.c,v 1.213 2010/08/26 22:00:19 tgl Exp $
3434
*
3535
*-------------------------------------------------------------------------
3636
*/
@@ -484,6 +484,11 @@ Lock_AF_UNIX(unsigned short portNumber, char *unixSocketName)
484484

485485
/*
486486
* Grab an interlock file associated with the socket file.
487+
*
488+
* Note: there are two reasons for using a socket lock file, rather than
489+
* trying to interlock directly on the socket itself. First, it's a lot
490+
* more portable, and second, it lets us remove any pre-existing socket
491+
* file without race conditions.
487492
*/
488493
CreateSocketLockFile(sock_path, true);
489494

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp