@@ -1359,14 +1359,18 @@ The commands accepted in walsender mode are:
1359
1359
has already been recycled. On success, server responds with a
1360
1360
CopyBothResponse message, and then starts to stream WAL to the frontend.
1361
1361
WAL will continue to be streamed until the connection is broken;
1362
- no further commands will be accepted.
1362
+ no further commands will be accepted. If the WAL sender process is
1363
+ terminated normally (during postmaster shutdown), it will send a
1364
+ CommandComplete message before exiting. This might not happen during an
1365
+ abnormal shutdown, of course.
1363
1366
</para>
1364
1367
1365
1368
<para>
1366
1369
WAL data is sent as a series of CopyData messages. (This allows
1367
1370
other information to be intermixed; in particular the server can send
1368
1371
an ErrorResponse message if it encounters a failure after beginning
1369
- to stream.) The payload in each CopyData message follows this format:
1372
+ to stream.) The payload of each CopyData message from server to the
1373
+ client contains a message of one of the following formats:
1370
1374
</para>
1371
1375
1372
1376
<para>
@@ -1390,34 +1394,32 @@ The commands accepted in walsender mode are:
1390
1394
</varlistentry>
1391
1395
<varlistentry>
1392
1396
<term>
1393
- Byte8
1397
+ Int64
1394
1398
</term>
1395
1399
<listitem>
1396
1400
<para>
1397
- The starting point of the WAL data in this message, given in
1398
- XLogRecPtr format.
1401
+ The starting point of the WAL data in this message.
1399
1402
</para>
1400
1403
</listitem>
1401
1404
</varlistentry>
1402
1405
<varlistentry>
1403
1406
<term>
1404
- Byte8
1407
+ Int64
1405
1408
</term>
1406
1409
<listitem>
1407
1410
<para>
1408
- The current end of WAL on the server, given in
1409
- XLogRecPtr format.
1411
+ The current end of WAL on the server.
1410
1412
</para>
1411
1413
</listitem>
1412
1414
</varlistentry>
1413
1415
<varlistentry>
1414
1416
<term>
1415
- Byte8
1417
+ Int64
1416
1418
</term>
1417
1419
<listitem>
1418
1420
<para>
1419
- The server's system clock at the time of transmission,
1420
- given in TimestampTz format .
1421
+ The server's system clock at the time of transmission, as
1422
+ microseconds since midnight on 2000-01-01 .
1421
1423
</para>
1422
1424
</listitem>
1423
1425
</varlistentry>
@@ -1429,42 +1431,19 @@ The commands accepted in walsender mode are:
1429
1431
<para>
1430
1432
A section of the WAL data stream.
1431
1433
</para>
1434
+ <para>
1435
+ A single WAL record is never split across two XLogData messages.
1436
+ When a WAL record crosses a WAL page boundary, and is therefore
1437
+ already split using continuation records, it can be split at the page
1438
+ boundary. In other words, the first main WAL record and its
1439
+ continuation records can be sent in different XLogData messages.
1440
+ </para>
1432
1441
</listitem>
1433
1442
</varlistentry>
1434
1443
</variablelist>
1435
1444
</para>
1436
1445
</listitem>
1437
1446
</varlistentry>
1438
- </variablelist>
1439
- </para>
1440
- <para>
1441
- A single WAL record is never split across two CopyData messages.
1442
- When a WAL record crosses a WAL page boundary, and is therefore
1443
- already split using continuation records, it can be split at the page
1444
- boundary. In other words, the first main WAL record and its
1445
- continuation records can be sent in different CopyData messages.
1446
- </para>
1447
- <para>
1448
- Note that all fields within the WAL data and the above-described header
1449
- will be in the sending server's native format. Endianness, and the
1450
- format for the timestamp, are unpredictable unless the receiver has
1451
- verified that the sender's system identifier matches its own
1452
- <filename>pg_control</> contents.
1453
- </para>
1454
- <para>
1455
- If the WAL sender process is terminated normally (during postmaster
1456
- shutdown), it will send a CommandComplete message before exiting.
1457
- This might not happen during an abnormal shutdown, of course.
1458
- </para>
1459
-
1460
- <para>
1461
- The receiving process can send replies back to the sender at any time,
1462
- using one of the following message formats (also in the payload of a
1463
- CopyData message):
1464
- </para>
1465
-
1466
- <para>
1467
- <variablelist>
1468
1447
<varlistentry>
1469
1448
<term>
1470
1449
Primary keepalive message (B)
@@ -1484,23 +1463,33 @@ The commands accepted in walsender mode are:
1484
1463
</varlistentry>
1485
1464
<varlistentry>
1486
1465
<term>
1487
- Byte8
1466
+ Int64
1488
1467
</term>
1489
1468
<listitem>
1490
1469
<para>
1491
- The current end of WAL on the server, given in
1492
- XLogRecPtr format.
1470
+ The current end of WAL on the server.
1493
1471
</para>
1494
1472
</listitem>
1495
1473
</varlistentry>
1496
1474
<varlistentry>
1497
1475
<term>
1498
- Byte8
1476
+ Int64
1499
1477
</term>
1500
1478
<listitem>
1501
1479
<para>
1502
- The server's system clock at the time of transmission,
1503
- given in TimestampTz format.
1480
+ The server's system clock at the time of transmission, as
1481
+ microseconds since midnight on 2000-01-01.
1482
+ </para>
1483
+ </listitem>
1484
+ </varlistentry>
1485
+ <varlistentry>
1486
+ <term>
1487
+ Byte1
1488
+ </term>
1489
+ <listitem>
1490
+ <para>
1491
+ 1 means that the client should reply to this message as soon as
1492
+ possible, to avoid a timeout disconnect. 0 otherwise.
1504
1493
</para>
1505
1494
</listitem>
1506
1495
</varlistentry>
@@ -1511,6 +1500,12 @@ The commands accepted in walsender mode are:
1511
1500
</variablelist>
1512
1501
</para>
1513
1502
1503
+ <para>
1504
+ The receiving process can send replies back to the sender at any time,
1505
+ using one of the following message formats (also in the payload of a
1506
+ CopyData message):
1507
+ </para>
1508
+
1514
1509
<para>
1515
1510
<variablelist>
1516
1511
<varlistentry>
@@ -1532,45 +1527,56 @@ The commands accepted in walsender mode are:
1532
1527
</varlistentry>
1533
1528
<varlistentry>
1534
1529
<term>
1535
- Byte8
1530
+ Int64
1536
1531
</term>
1537
1532
<listitem>
1538
1533
<para>
1539
1534
The location of the last WAL byte + 1 received and written to disk
1540
- in the standby, in XLogRecPtr format .
1535
+ in the standby.
1541
1536
</para>
1542
1537
</listitem>
1543
1538
</varlistentry>
1544
1539
<varlistentry>
1545
1540
<term>
1546
- Byte8
1541
+ Int64
1547
1542
</term>
1548
1543
<listitem>
1549
1544
<para>
1550
1545
The location of the last WAL byte + 1 flushed to disk in
1551
- the standby, in XLogRecPtr format.
1546
+ the standby.
1547
+ </para>
1548
+ </listitem>
1549
+ </varlistentry>
1550
+ <varlistentry>
1551
+ <term>
1552
+ Int64
1553
+ </term>
1554
+ <listitem>
1555
+ <para>
1556
+ The location of the last WAL byte + 1 applied in the standby.
1552
1557
</para>
1553
1558
</listitem>
1554
1559
</varlistentry>
1555
1560
<varlistentry>
1556
1561
<term>
1557
- Byte8
1562
+ Int64
1558
1563
</term>
1559
1564
<listitem>
1560
1565
<para>
1561
- The location of the last WAL byte + 1 applied in the standby, in
1562
- XLogRecPtr format .
1566
+ The client's system clock at the time of transmission, as
1567
+ microseconds since midnight on 2000-01-01 .
1563
1568
</para>
1564
1569
</listitem>
1565
1570
</varlistentry>
1566
1571
<varlistentry>
1567
1572
<term>
1568
- Byte8
1573
+ Byte1
1569
1574
</term>
1570
1575
<listitem>
1571
1576
<para>
1572
- The server's system clock at the time of transmission,
1573
- given in TimestampTz format.
1577
+ If 1, the client requests the server to reply to this message
1578
+ immediately. This can be used to ping the server, to test if
1579
+ the connection is still healthy.
1574
1580
</para>
1575
1581
</listitem>
1576
1582
</varlistentry>
@@ -1602,28 +1608,29 @@ The commands accepted in walsender mode are:
1602
1608
</varlistentry>
1603
1609
<varlistentry>
1604
1610
<term>
1605
- Byte8
1611
+ Int64
1606
1612
</term>
1607
1613
<listitem>
1608
1614
<para>
1609
- The server 's system clock at the time of transmission,
1610
- given in TimestampTz format .
1615
+ The client 's system clock at the time of transmission, as
1616
+ microseconds since midnight on 2000-01-01 .
1611
1617
</para>
1612
1618
</listitem>
1613
1619
</varlistentry>
1614
1620
<varlistentry>
1615
1621
<term>
1616
- Byte4
1622
+ Int32
1617
1623
</term>
1618
1624
<listitem>
1619
1625
<para>
1620
- The standby's current xmin.
1626
+ The standby's current xmin. This may be 0, if the standby does not
1627
+ support feedback, or is not yet in Hot Standby state.
1621
1628
</para>
1622
1629
</listitem>
1623
1630
</varlistentry>
1624
1631
<varlistentry>
1625
1632
<term>
1626
- Byte4
1633
+ Int32
1627
1634
</term>
1628
1635
<listitem>
1629
1636
<para>
0 commit comments