Correct several behavior descriptions in comments.
authorNoah Misch <[email protected]>
Sun, 16 Aug 2020 03:21:52 +0000 (20:21 -0700)
committerNoah Misch <[email protected]>
Sun, 16 Aug 2020 03:21:52 +0000 (20:21 -0700)
Reuse cautionary language from src/test/ssl/README in
src/test/kerberos/README.  SLRUs have had access to six-character
segments names since commit 73c986adde5d73a5e2555da9b5c8facedb146dcd,
and recovery stopped calling HeapTupleHeaderAdvanceLatestRemovedXid() in
commit 558a9165e081d1936573e5a7d576f5febd7fb55a.  The other corrections
are more self-evident.

12 files changed:
src/backend/access/heap/heapam.c
src/backend/access/transam/README
src/backend/access/transam/varsup.c
src/backend/commands/async.c
src/backend/commands/vacuum.c
src/backend/storage/buffer/bufmgr.c
src/bin/pg_waldump/pg_waldump.c
src/include/access/xlog_internal.h
src/test/kerberos/README
src/test/perl/PostgresNode.pm
src/test/recovery/t/010_logical_decoding_timelines.pl
src/test/ssl/t/SSLServer.pm

index f75e1cf0e7b0f69e5de5763b41eac2f596b5897e..9b5f417eac442bfe8e00312f41bbbe0377a1466a 100644 (file)
@@ -6920,8 +6920,6 @@ HeapTupleHeaderAdvanceLatestRemovedXid(HeapTupleHeader tuple,
     * updated/deleted by the inserting transaction.
     *
     * Look for a committed hint bit, or if no xmin bit is set, check clog.
-    * This needs to work on both primary and standby, where it is used to
-    * assess btree delete records.
     */
    if (HeapTupleHeaderXminCommitted(tuple) ||
        (!HeapTupleHeaderXminInvalid(tuple) && TransactionIdDidCommit(xmin)))
index c5f09667ba159834a19516b7ff45069c44dc8ada..1edc8180c1284425fcdb4ec14893290afb054941 100644 (file)
@@ -635,12 +635,11 @@ be reconstructed later following a crash and the action is simply a way
 of optimising for performance. When a hint is written we use
 MarkBufferDirtyHint() to mark the block dirty.
 
-If the buffer is clean and checksums are in use then
-MarkBufferDirtyHint() inserts an XLOG_FPI record to ensure that we
-take a full page image that includes the hint. We do this to avoid
-a partial page write, when we write the dirtied page. WAL is not
-written during recovery, so we simply skip dirtying blocks because
-of hints when in recovery.
+If the buffer is clean and checksums are in use then MarkBufferDirtyHint()
+inserts an XLOG_FPI_FOR_HINT record to ensure that we take a full page image
+that includes the hint. We do this to avoid a partial page write, when we
+write the dirtied page. WAL is not written during recovery, so we simply skip
+dirtying blocks because of hints when in recovery.
 
 If you do decide to optimise away a WAL record, then any calls to
 MarkBufferDirty() must be replaced by MarkBufferDirtyHint(),
index 2d2b05be36c47f7504dacf42766c0e4ebe7f196f..a4944faa32e3449065367398489f3c4e96d432f2 100644 (file)
@@ -367,12 +367,13 @@ SetTransactionIdLimit(TransactionId oldest_datfrozenxid, Oid oldest_datoid)
     * We'll refuse to continue assigning XIDs in interactive mode once we get
     * within 3M transactions of data loss.  This leaves lots of room for the
     * DBA to fool around fixing things in a standalone backend, while not
-    * being significant compared to total XID space. (Note that since
-    * vacuuming requires one transaction per table cleaned, we had better be
-    * sure there's lots of XIDs left...)  Also, at default BLCKSZ, this
-    * leaves two completely-idle segments.  In the event of edge-case bugs
-    * involving page or segment arithmetic, idle segments render the bugs
-    * unreachable outside of single-user mode.
+    * being significant compared to total XID space. (VACUUM requires an XID
+    * if it truncates at wal_level!=minimal.  "VACUUM (ANALYZE)", which a DBA
+    * might do by reflex, assigns an XID.  Hence, we had better be sure
+    * there's lots of XIDs left...)  Also, at default BLCKSZ, this leaves two
+    * completely-idle segments.  In the event of edge-case bugs involving
+    * page or segment arithmetic, idle segments render the bugs unreachable
+    * outside of single-user mode.
     */
    xidStopLimit = xidWrapLimit - 3000000;
    if (xidStopLimit < FirstNormalTransactionId)
index 4c1286eb988eea89378dc53f37882e4b213edfd5..774b26fd2c4d22e89fc932ec08c7250e2d9262a1 100644 (file)
@@ -302,13 +302,10 @@ static SlruCtlData NotifyCtlData;
 #define QUEUE_FULL_WARN_INTERVAL   5000    /* warn at most once every 5s */
 
 /*
- * slru.c currently assumes that all filenames are four characters of hex
- * digits. That means that we can use segments 0000 through FFFF.
- * Each segment contains SLRU_PAGES_PER_SEGMENT pages which gives us
- * the pages from 0 to SLRU_PAGES_PER_SEGMENT * 0x10000 - 1.
- *
- * It's of course possible to enhance slru.c, but this gives us so much
- * space already that it doesn't seem worth the trouble.
+ * Use segments 0000 through FFFF.  Each contains SLRU_PAGES_PER_SEGMENT pages
+ * which gives us the pages from 0 to SLRU_PAGES_PER_SEGMENT * 0x10000 - 1.
+ * We could use as many segments as SlruScanDirectory() allows, but this gives
+ * us so much space already that it doesn't seem worth the trouble.
  *
  * The most data we can have in the queue at a time is QUEUE_MAX_PAGE/2
  * pages, because more than that would confuse slru.c into thinking there
index 5189a5ad5e376c7fc1071b1187a3647e8a1d20e7..23eb605d4cb2562139e7f96f3f17037bbaacfb2f 100644 (file)
@@ -949,11 +949,11 @@ vacuum_set_xid_limits(Relation rel,
    /*
     * We can always ignore processes running lazy vacuum.  This is because we
     * use these values only for deciding which tuples we must keep in the
-    * tables.  Since lazy vacuum doesn't write its XID anywhere, it's safe to
-    * ignore it.  In theory it could be problematic to ignore lazy vacuums in
-    * a full vacuum, but keep in mind that only one vacuum process can be
-    * working on a particular table at any time, and that each vacuum is
-    * always an independent transaction.
+    * tables.  Since lazy vacuum doesn't write its XID anywhere (usually no
+    * XID assigned), it's safe to ignore it.  In theory it could be
+    * problematic to ignore lazy vacuums in a full vacuum, but keep in mind
+    * that only one vacuum process can be working on a particular table at
+    * any time, and that each vacuum is always an independent transaction.
     */
    *oldestXmin = GetOldestNonRemovableTransactionId(rel);
 
index f1ae6f9f844306dcf049f8fd77ef7dff0a6aadab..a2a963bd5b41f7e6d9ea3633fe9e1ee1a78e4e01 100644 (file)
@@ -3578,7 +3578,7 @@ IncrBufferRefCount(Buffer buffer)
  * This is essentially the same as MarkBufferDirty, except:
  *
  * 1. The caller does not write WAL; so if checksums are enabled, we may need
- *   to write an XLOG_FPI WAL record to protect against torn pages.
+ *   to write an XLOG_FPI_FOR_HINT WAL record to protect against torn pages.
  * 2. The caller might have only share-lock instead of exclusive-lock on the
  *   buffer's content lock.
  * 3. This function does not guarantee that the buffer is always marked dirty
index d1a06789353971564d64844c388c51abfbc938e3..31e99c2a6da5dbd67a87ed0472fc20be3a7ebe82 100644 (file)
@@ -611,14 +611,9 @@ XLogDumpDisplayStats(XLogDumpConfig *config, XLogDumpStats *stats)
    double      rec_len_pct,
                fpi_len_pct;
 
-   /* ---
-    * Make a first pass to calculate column totals:
-    * count(*),
-    * sum(xl_len+SizeOfXLogRecord),
-    * sum(xl_tot_len-xl_len-SizeOfXLogRecord), and
-    * sum(xl_tot_len).
-    * These are used to calculate percentages for each record type.
-    * ---
+   /*
+    * Each row shows its percentages of the total, so make a first pass to
+    * calculate column totals.
     */
 
    for (ri = 0; ri < RM_NEXT_ID; ri++)
index 9b2da56379e1507a15a6afdfd2231c9af7284126..4146753d4765dbc95d0bb6a84de4a32f3a9b78d8 100644 (file)
@@ -43,11 +43,8 @@ typedef struct XLogPageHeaderData
    /*
     * When there is not enough space on current page for whole record, we
     * continue on the next page.  xlp_rem_len is the number of bytes
-    * remaining from a previous page.
-    *
-    * Note that xlp_rem_len includes backup-block data; that is, it tracks
-    * xl_tot_len not xl_len in the initial header.  Also note that the
-    * continuation data isn't necessarily aligned.
+    * remaining from a previous page; it tracks xl_tot_len in the initial
+    * header.  Note that the continuation data isn't necessarily aligned.
     */
    uint32      xlp_rem_len;    /* total len of remaining data for record */
 } XLogPageHeaderData;
index 93af72e1636792255f77803d29401570ab8f91cd..fa9c03e78291570883250d711685189354a535e2 100644 (file)
@@ -8,10 +8,12 @@ functionality.  This requires a full MIT Kerberos installation,
 including server and client tools, and is therefore kept separate and
 not run by default.
 
-Also, this test suite creates a KDC server that listens for TCP/IP
-connections on localhost without any real access control, so it is not
-safe to run this on a system where there might be untrusted local
-users.
+CAUTION: The test server run by this test is configured to listen for TCP
+connections on localhost. Any user on the same host is able to log in to the
+test server while the tests are running. Do not run this suite on a multi-user
+system where you don't trust all local users! Also, this test suite creates a
+KDC server that listens for TCP/IP connections on localhost without any real
+access control.
 
 Running the tests
 =================
index 8c1b77376fb081a7f365f0f41a76ce7d9587b104..1488bffa2ba34edc36514edf09d706b31468bb60 100644 (file)
@@ -1234,10 +1234,8 @@ sub can_bind
    return $ret;
 }
 
-# Automatically shut down any still-running nodes when the test script exits.
-# Note that this just stops the postmasters (in the same order the nodes were
-# created in).  Any temporary directories are deleted, in an unspecified
-# order, later when the File::Temp objects are destroyed.
+# Automatically shut down any still-running nodes (in the same order the nodes
+# were created in) when the test script exits.
 END
 {
 
index 09aaefa9f032e30fdfe2fc0e7768c7abd5e5bbfc..329500f0ae5b77a08c1d0762ed7c0a20129f6a90 100644 (file)
@@ -111,7 +111,7 @@ is($stdout, 'before_basebackup',
 # Examine the physical slot the replica uses to stream changes
 # from the primary to make sure its hot_standby_feedback
 # has locked in a catalog_xmin on the physical slot, and that
-# any xmin is < the catalog_xmin
+# any xmin is >= the catalog_xmin
 $node_primary->poll_query_until(
    'postgres', q[
    SELECT catalog_xmin IS NOT NULL
index 1e392b8fbf614f820c275dedf77af2364f17a6ed..f5987a003efd67de0b13d4d29e10a0043767ffbe 100644 (file)
@@ -9,7 +9,6 @@
 # - a database called trustdb that lets anyone in
 # - another database called certdb that uses certificate authentication, ie.
 #   the client must present a valid certificate signed by the client CA
-# - two users, called ssltestuser and anotheruser.
 #
 # The server is configured to only accept connections from localhost. If you
 # want to run the client from another host, you'll have to configure that