@hoshinotatsuya/pg-replica-sync 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/dist/compare-lsn.d.mts +3 -3
- package/dist/compare-lsn.d.ts +3 -3
- package/dist/compare-lsn.js +3 -3
- package/dist/constants/exclusion-reason.constant.d.mts +12 -12
- package/dist/constants/exclusion-reason.constant.d.ts +12 -12
- package/dist/constants/exclusion-reason.constant.d.ts.map +1 -1
- package/dist/constants/exclusion-reason.constant.js +12 -12
- package/dist/constants/exclusion-reason.constant.js.map +1 -1
- package/dist/constants/node-role.constant.d.mts +1 -1
- package/dist/constants/node-role.constant.d.ts +1 -1
- package/dist/constants/node-role.constant.d.ts.map +1 -1
- package/dist/constants/node-role.constant.js +1 -1
- package/dist/constants/node-role.constant.js.map +1 -1
- package/dist/constants/probe-sql.constant.d.mts +25 -25
- package/dist/constants/probe-sql.constant.d.ts +25 -25
- package/dist/constants/probe-sql.constant.js +25 -25
- package/dist/constants/replica-sync-defaults.constant.d.mts +26 -26
- package/dist/constants/replica-sync-defaults.constant.d.ts +26 -26
- package/dist/constants/replica-sync-defaults.constant.d.ts.map +1 -1
- package/dist/constants/replica-sync-defaults.constant.js +26 -26
- package/dist/constants/replica-sync-defaults.constant.js.map +1 -1
- package/dist/constants/route-reason.constant.d.mts +13 -13
- package/dist/constants/route-reason.constant.d.ts +13 -13
- package/dist/constants/route-reason.constant.d.ts.map +1 -1
- package/dist/constants/route-reason.constant.js +13 -13
- package/dist/constants/route-reason.constant.js.map +1 -1
- package/dist/constants/token-format.constant.d.mts +11 -11
- package/dist/constants/token-format.constant.d.ts +11 -11
- package/dist/constants/token-format.constant.d.ts.map +1 -1
- package/dist/constants/token-format.constant.js +11 -11
- package/dist/constants/token-format.constant.js.map +1 -1
- package/dist/constants/wal-format.constant.d.mts +6 -6
- package/dist/constants/wal-format.constant.d.ts +6 -6
- package/dist/constants/wal-format.constant.d.ts.map +1 -1
- package/dist/constants/wal-format.constant.js +6 -6
- package/dist/constants/wal-format.constant.js.map +1 -1
- package/dist/decode-canonical-base64url.d.mts +1 -1
- package/dist/decode-canonical-base64url.d.ts +1 -1
- package/dist/decode-canonical-base64url.d.ts.map +1 -1
- package/dist/decode-canonical-base64url.js +1 -1
- package/dist/decode-canonical-base64url.js.map +1 -1
- package/dist/deep-freeze.d.mts +7 -7
- package/dist/deep-freeze.d.ts +7 -7
- package/dist/deep-freeze.js +9 -9
- package/dist/deep-freeze.js.map +1 -1
- package/dist/destroy-client.d.mts +3 -3
- package/dist/destroy-client.d.ts +3 -3
- package/dist/destroy-client.js +3 -3
- package/dist/evaluate-replica.d.mts +3 -3
- package/dist/evaluate-replica.d.ts +3 -3
- package/dist/evaluate-replica.js +3 -3
- package/dist/format-lsn.d.mts +1 -1
- package/dist/format-lsn.d.ts +1 -1
- package/dist/format-lsn.d.ts.map +1 -1
- package/dist/format-lsn.js +2 -2
- package/dist/format-lsn.js.map +1 -1
- package/dist/invalid-lsn.error.d.mts +1 -1
- package/dist/invalid-lsn.error.d.ts +1 -1
- package/dist/invalid-lsn.error.d.ts.map +1 -1
- package/dist/invalid-lsn.error.js +2 -2
- package/dist/invalid-lsn.error.js.map +1 -1
- package/dist/invalid-replica-sync-options.error.d.mts +1 -1
- package/dist/invalid-replica-sync-options.error.d.ts +1 -1
- package/dist/invalid-replica-sync-options.error.d.ts.map +1 -1
- package/dist/invalid-replica-sync-options.error.js +1 -1
- package/dist/invalid-replica-sync-options.error.js.map +1 -1
- package/dist/lag-bytes.d.mts +3 -3
- package/dist/lag-bytes.d.ts +3 -3
- package/dist/lag-bytes.js +3 -3
- package/dist/lsn-or-null.d.mts +1 -1
- package/dist/lsn-or-null.d.ts +1 -1
- package/dist/lsn-or-null.d.ts.map +1 -1
- package/dist/lsn-or-null.js +1 -1
- package/dist/lsn-or-null.js.map +1 -1
- package/dist/notify.d.mts +7 -7
- package/dist/notify.d.ts +7 -7
- package/dist/notify.js +8 -8
- package/dist/notify.js.map +1 -1
- package/dist/parse-lsn.d.mts +3 -3
- package/dist/parse-lsn.d.ts +3 -3
- package/dist/parse-lsn.js +3 -3
- package/dist/probe-connection-closed.error.d.mts +1 -1
- package/dist/probe-connection-closed.error.d.ts +1 -1
- package/dist/probe-connection-closed.error.d.ts.map +1 -1
- package/dist/probe-connection-closed.error.js +2 -2
- package/dist/probe-connection-closed.error.js.map +1 -1
- package/dist/probe-connection.d.mts +20 -20
- package/dist/probe-connection.d.ts +20 -20
- package/dist/probe-connection.d.ts.map +1 -1
- package/dist/probe-connection.js +25 -25
- package/dist/probe-connection.js.map +1 -1
- package/dist/probe-timeout.error.d.mts +1 -1
- package/dist/probe-timeout.error.d.ts +1 -1
- package/dist/probe-timeout.error.d.ts.map +1 -1
- package/dist/probe-timeout.error.js +2 -2
- package/dist/probe-timeout.error.js.map +1 -1
- package/dist/read-node-state.d.mts +3 -3
- package/dist/read-node-state.d.ts +3 -3
- package/dist/read-node-state.js +4 -4
- package/dist/read-node-state.js.map +1 -1
- package/dist/replica-router.d.mts +133 -133
- package/dist/replica-router.d.ts +133 -133
- package/dist/replica-router.d.ts.map +1 -1
- package/dist/replica-router.js +162 -162
- package/dist/replica-router.js.map +1 -1
- package/dist/require-integer.d.mts +1 -1
- package/dist/require-integer.d.ts +1 -1
- package/dist/require-integer.d.ts.map +1 -1
- package/dist/require-integer.js +3 -3
- package/dist/require-integer.js.map +1 -1
- package/dist/secret-weakness.d.mts +13 -13
- package/dist/secret-weakness.d.ts +13 -13
- package/dist/secret-weakness.js +16 -16
- package/dist/secret-weakness.js.map +1 -1
- package/dist/smallest-period.d.mts +4 -4
- package/dist/smallest-period.d.ts +4 -4
- package/dist/smallest-period.js +4 -4
- package/dist/sql-state-of.d.mts +6 -6
- package/dist/sql-state-of.d.ts +6 -6
- package/dist/sql-state-of.js +6 -6
- package/dist/state-cache.d.mts +14 -14
- package/dist/state-cache.d.ts +14 -14
- package/dist/state-cache.d.ts.map +1 -1
- package/dist/state-cache.js +15 -15
- package/dist/state-cache.js.map +1 -1
- package/dist/timeline-of.d.mts +2 -2
- package/dist/timeline-of.d.ts +2 -2
- package/dist/timeline-of.js +2 -2
- package/dist/to-error.d.mts +1 -1
- package/dist/to-error.d.ts +1 -1
- package/dist/to-error.d.ts.map +1 -1
- package/dist/to-error.js +1 -1
- package/dist/to-error.js.map +1 -1
- package/dist/token-codec.d.mts +10 -10
- package/dist/token-codec.d.ts +10 -10
- package/dist/token-codec.js +31 -31
- package/dist/token-codec.js.map +1 -1
- package/dist/token-lsn.d.mts +13 -13
- package/dist/token-lsn.d.ts +13 -13
- package/dist/token-lsn.js +13 -13
- package/dist/transaction-not-committed.error.d.mts +2 -2
- package/dist/transaction-not-committed.error.d.ts +2 -2
- package/dist/transaction-not-committed.error.d.ts.map +1 -1
- package/dist/transaction-not-committed.error.js +3 -3
- package/dist/transaction-not-committed.error.js.map +1 -1
- package/dist/transaction-not-open.error.d.mts +5 -5
- package/dist/transaction-not-open.error.d.ts +5 -5
- package/dist/transaction-not-open.error.js +6 -6
- package/dist/transaction-not-open.error.js.map +1 -1
- package/dist/types/cache-entry.type.d.mts +4 -4
- package/dist/types/cache-entry.type.d.ts +4 -4
- package/dist/types/clock.type.d.mts +3 -3
- package/dist/types/clock.type.d.ts +3 -3
- package/dist/types/confirm-event.type.d.mts +3 -3
- package/dist/types/confirm-event.type.d.ts +3 -3
- package/dist/types/decoded-token.type.d.mts +2 -2
- package/dist/types/decoded-token.type.d.ts +2 -2
- package/dist/types/evaluated.type.d.mts +1 -1
- package/dist/types/evaluated.type.d.ts +1 -1
- package/dist/types/evaluated.type.d.ts.map +1 -1
- package/dist/types/exclusion.type.d.mts +1 -1
- package/dist/types/exclusion.type.d.ts +1 -1
- package/dist/types/exclusion.type.d.ts.map +1 -1
- package/dist/types/node-state.type.d.mts +13 -13
- package/dist/types/node-state.type.d.ts +13 -13
- package/dist/types/node-state.type.d.ts.map +1 -1
- package/dist/types/not-a-pool.type.d.mts +5 -5
- package/dist/types/not-a-pool.type.d.ts +5 -5
- package/dist/types/probe-event.type.d.mts +1 -1
- package/dist/types/probe-event.type.d.ts +1 -1
- package/dist/types/probe-event.type.d.ts.map +1 -1
- package/dist/types/probe-outcome.type.d.mts +1 -1
- package/dist/types/probe-outcome.type.d.ts +1 -1
- package/dist/types/probe-outcome.type.d.ts.map +1 -1
- package/dist/types/probe-sample.type.d.mts +1 -1
- package/dist/types/probe-sample.type.d.ts +1 -1
- package/dist/types/probe-sample.type.d.ts.map +1 -1
- package/dist/types/replica-node.type.d.mts +7 -7
- package/dist/types/replica-node.type.d.ts +7 -7
- package/dist/types/replica-requirement.type.d.mts +2 -2
- package/dist/types/replica-requirement.type.d.ts +2 -2
- package/dist/types/replica-router-options.type.d.mts +25 -25
- package/dist/types/replica-router-options.type.d.ts +25 -25
- package/dist/types/replica-router-options.type.d.ts.map +1 -1
- package/dist/types/route-decision.type.d.mts +5 -5
- package/dist/types/route-decision.type.d.ts +5 -5
- package/dist/types/route-decision.type.d.ts.map +1 -1
- package/dist/types/router-observer.type.d.mts +5 -5
- package/dist/types/router-observer.type.d.ts +5 -5
- package/dist/types/router-observer.type.d.ts.map +1 -1
- package/dist/types/router-stats.type.d.mts +8 -8
- package/dist/types/router-stats.type.d.ts +8 -8
- package/dist/types/router-stats.type.d.ts.map +1 -1
- package/dist/types/sql-command-executor.type.d.mts +4 -4
- package/dist/types/sql-command-executor.type.d.ts +4 -4
- package/dist/types/sql-query-executor.type.d.mts +3 -3
- package/dist/types/sql-query-executor.type.d.ts +3 -3
- package/dist/types/wal-layout.type.d.mts +1 -1
- package/dist/types/wal-layout.type.d.ts +1 -1
- package/dist/types/wal-layout.type.d.ts.map +1 -1
- package/dist/types/wal-position.type.d.mts +5 -5
- package/dist/types/wal-position.type.d.ts +5 -5
- package/dist/types/wal-position.type.d.ts.map +1 -1
- package/dist/value-text.d.mts +5 -5
- package/dist/value-text.d.ts +5 -5
- package/dist/value-text.js +6 -6
- package/dist/value-text.js.map +1 -1
- package/dist/wal-layout-of.d.mts +1 -1
- package/dist/wal-layout-of.d.ts +1 -1
- package/dist/wal-layout-of.d.ts.map +1 -1
- package/dist/wal-layout-of.js +1 -1
- package/dist/wal-layout-of.js.map +1 -1
- package/package.json +11 -9
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** The router defaults; each one is overridden by an option with the same meaning. */
|
|
2
2
|
export declare const REPLICA_SYNC_DEFAULTS: {
|
|
3
|
-
/**
|
|
3
|
+
/** How long a node state lives in the cache, ms. */
|
|
4
4
|
readonly STATE_TTL_MS: 250;
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* The ceiling of `stateTtlMs`, ms: the window in which a replica restart (the replay
|
|
7
|
+
* position after it is SMALLER — a rollback to minRecoveryPoint) may stay
|
|
8
|
+
* unnoticed if the loss of the probe connection did not reach the client.
|
|
9
9
|
*/
|
|
10
10
|
readonly MAX_STATE_TTL_MS: 1000;
|
|
11
|
-
/**
|
|
11
|
+
/** The ceiling of one probe (connection establishment + query), ms. */
|
|
12
12
|
readonly PROBE_TIMEOUT_MS: 1000;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `PROBE_TIMEOUT_MS
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* The lifetime ceiling of a probe connection that did not get established or on which a query
|
|
15
|
+
* did not answer, ms (from the start of the establishment or the query). A probe that did not fit into
|
|
16
|
+
* `PROBE_TIMEOUT_MS` is a refusal of this probe, but the connection is not torn until this
|
|
17
|
+
* ceiling: a slow but alive replica (establishment longer than the probe ceiling) gets
|
|
18
|
+
* a ready connection for the next probe, and a frozen one stays unavailable.
|
|
19
19
|
*/
|
|
20
20
|
readonly CONNECT_TIMEOUT_MS: 10000;
|
|
21
|
-
/**
|
|
21
|
+
/** How long a node that did not answer a probe is not polled again, ms. */
|
|
22
22
|
readonly UNAVAILABLE_RETRY_MS: 2000;
|
|
23
|
-
/**
|
|
23
|
+
/** Without a token: the ceiling of a replica lag behind the primary, bytes of WAL. */
|
|
24
24
|
readonly MAX_LAG_BYTES: 1048576;
|
|
25
|
-
/**
|
|
25
|
+
/** Waiting for catch-up before going to the primary, ms (0 — do not wait). */
|
|
26
26
|
readonly WAIT_FOR_CATCH_UP_MS: 0;
|
|
27
|
-
/**
|
|
27
|
+
/** The interval of polling the replicas during the wait, ms. */
|
|
28
28
|
readonly CATCH_UP_POLL_MS: 10;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* No more than one new probe of a node per this many ms, with any number of reads:
|
|
31
|
+
* a token ahead of a replica requires a fresh probe, and without a ceiling lagging replicas
|
|
32
|
+
* would be polled on every read.
|
|
33
33
|
*/
|
|
34
34
|
readonly MIN_PROBE_INTERVAL_MS: 10;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
* (
|
|
38
|
-
*
|
|
39
|
-
*
|
|
36
|
+
* How long a token that after a failover no replica can satisfy
|
|
37
|
+
* (another timeline, another cluster, ahead of the primary) holds reads on the
|
|
38
|
+
* primary, ms; an older one is read as without a token. A token "without a position" does not
|
|
39
|
+
* age: its position is unknown.
|
|
40
40
|
*/
|
|
41
41
|
readonly TOKEN_TTL_MS: 60000;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
43
|
+
* How many token positions the router remembers (the moment of the first encounter — for
|
|
44
|
+
* the probe frequency ceiling and expiry); the one not seen for the longest time is evicted (LRU).
|
|
45
45
|
*/
|
|
46
46
|
readonly POSITION_MEMORY: 1024;
|
|
47
|
-
/**
|
|
47
|
+
/** The ceiling of values that go into timers (`setTimeout` above 2³¹−1 ms fires after 1 ms). */
|
|
48
48
|
readonly MAX_TIMER_MS: 2147483647;
|
|
49
|
-
/** `application_name`
|
|
49
|
+
/** The `application_name` of the probe connections if the address does not set it: visible in pg_stat_activity. */
|
|
50
50
|
readonly APPLICATION_NAME: "pg-replica-sync";
|
|
51
51
|
};
|
|
52
52
|
//# sourceMappingURL=replica-sync-defaults.constant.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replica-sync-defaults.constant.d.ts","sourceRoot":"","sources":["../../src/constants/replica-sync-defaults.constant.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"replica-sync-defaults.constant.d.ts","sourceRoot":"","sources":["../../src/constants/replica-sync-defaults.constant.ts"],"names":[],"mappings":"AAEA,sFAAsF;AACtF,eAAO,MAAM,qBAAqB;IAChC,oDAAoD;;IAEpD;;;;OAIG;;IAEH,uEAAuE;;IAEvE;;;;;;OAMG;;IAEH,2EAA2E;;IAE3E,sFAAsF;;IAEtF,8EAA8E;;IAE9E,gEAAgE;;IAEhE;;;;OAIG;;IAEH;;;;;OAKG;;IAEH;;;OAGG;;IAEH,gGAAgG;;IAEhG,mHAAmH;;CAE3G,CAAC"}
|
|
@@ -2,55 +2,55 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.REPLICA_SYNC_DEFAULTS = void 0;
|
|
4
4
|
const deep_freeze_1 = require("../deep-freeze");
|
|
5
|
-
/**
|
|
5
|
+
/** The router defaults; each one is overridden by an option with the same meaning. */
|
|
6
6
|
exports.REPLICA_SYNC_DEFAULTS = {
|
|
7
|
-
/**
|
|
7
|
+
/** How long a node state lives in the cache, ms. */
|
|
8
8
|
STATE_TTL_MS: 250,
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* The ceiling of `stateTtlMs`, ms: the window in which a replica restart (the replay
|
|
11
|
+
* position after it is SMALLER — a rollback to minRecoveryPoint) may stay
|
|
12
|
+
* unnoticed if the loss of the probe connection did not reach the client.
|
|
13
13
|
*/
|
|
14
14
|
MAX_STATE_TTL_MS: 1_000,
|
|
15
|
-
/**
|
|
15
|
+
/** The ceiling of one probe (connection establishment + query), ms. */
|
|
16
16
|
PROBE_TIMEOUT_MS: 1_000,
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* `PROBE_TIMEOUT_MS
|
|
21
|
-
*
|
|
22
|
-
*
|
|
18
|
+
* The lifetime ceiling of a probe connection that did not get established or on which a query
|
|
19
|
+
* did not answer, ms (from the start of the establishment or the query). A probe that did not fit into
|
|
20
|
+
* `PROBE_TIMEOUT_MS` is a refusal of this probe, but the connection is not torn until this
|
|
21
|
+
* ceiling: a slow but alive replica (establishment longer than the probe ceiling) gets
|
|
22
|
+
* a ready connection for the next probe, and a frozen one stays unavailable.
|
|
23
23
|
*/
|
|
24
24
|
CONNECT_TIMEOUT_MS: 10_000,
|
|
25
|
-
/**
|
|
25
|
+
/** How long a node that did not answer a probe is not polled again, ms. */
|
|
26
26
|
UNAVAILABLE_RETRY_MS: 2_000,
|
|
27
|
-
/**
|
|
27
|
+
/** Without a token: the ceiling of a replica lag behind the primary, bytes of WAL. */
|
|
28
28
|
MAX_LAG_BYTES: 1_048_576,
|
|
29
|
-
/**
|
|
29
|
+
/** Waiting for catch-up before going to the primary, ms (0 — do not wait). */
|
|
30
30
|
WAIT_FOR_CATCH_UP_MS: 0,
|
|
31
|
-
/**
|
|
31
|
+
/** The interval of polling the replicas during the wait, ms. */
|
|
32
32
|
CATCH_UP_POLL_MS: 10,
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
34
|
+
* No more than one new probe of a node per this many ms, with any number of reads:
|
|
35
|
+
* a token ahead of a replica requires a fresh probe, and without a ceiling lagging replicas
|
|
36
|
+
* would be polled on every read.
|
|
37
37
|
*/
|
|
38
38
|
MIN_PROBE_INTERVAL_MS: 10,
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
* (
|
|
42
|
-
*
|
|
43
|
-
*
|
|
40
|
+
* How long a token that after a failover no replica can satisfy
|
|
41
|
+
* (another timeline, another cluster, ahead of the primary) holds reads on the
|
|
42
|
+
* primary, ms; an older one is read as without a token. A token "without a position" does not
|
|
43
|
+
* age: its position is unknown.
|
|
44
44
|
*/
|
|
45
45
|
TOKEN_TTL_MS: 60_000,
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
47
|
+
* How many token positions the router remembers (the moment of the first encounter — for
|
|
48
|
+
* the probe frequency ceiling and expiry); the one not seen for the longest time is evicted (LRU).
|
|
49
49
|
*/
|
|
50
50
|
POSITION_MEMORY: 1_024,
|
|
51
|
-
/**
|
|
51
|
+
/** The ceiling of values that go into timers (`setTimeout` above 2³¹−1 ms fires after 1 ms). */
|
|
52
52
|
MAX_TIMER_MS: 2_147_483_647,
|
|
53
|
-
/** `application_name`
|
|
53
|
+
/** The `application_name` of the probe connections if the address does not set it: visible in pg_stat_activity. */
|
|
54
54
|
APPLICATION_NAME: 'pg-replica-sync',
|
|
55
55
|
};
|
|
56
56
|
(0, deep_freeze_1.deepFreeze)(exports.REPLICA_SYNC_DEFAULTS);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replica-sync-defaults.constant.js","sourceRoot":"","sources":["../../src/constants/replica-sync-defaults.constant.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C,
|
|
1
|
+
{"version":3,"file":"replica-sync-defaults.constant.js","sourceRoot":"","sources":["../../src/constants/replica-sync-defaults.constant.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C,sFAAsF;AACzE,QAAA,qBAAqB,GAAG;IACnC,oDAAoD;IACpD,YAAY,EAAE,GAAG;IACjB;;;;OAIG;IACH,gBAAgB,EAAE,KAAK;IACvB,uEAAuE;IACvE,gBAAgB,EAAE,KAAK;IACvB;;;;;;OAMG;IACH,kBAAkB,EAAE,MAAM;IAC1B,2EAA2E;IAC3E,oBAAoB,EAAE,KAAK;IAC3B,sFAAsF;IACtF,aAAa,EAAE,SAAS;IACxB,8EAA8E;IAC9E,oBAAoB,EAAE,CAAC;IACvB,gEAAgE;IAChE,gBAAgB,EAAE,EAAE;IACpB;;;;OAIG;IACH,qBAAqB,EAAE,EAAE;IACzB;;;;;OAKG;IACH,YAAY,EAAE,MAAM;IACpB;;;OAGG;IACH,eAAe,EAAE,KAAK;IACtB,gGAAgG;IAChG,YAAY,EAAE,aAAa;IAC3B,mHAAmH;IACnH,gBAAgB,EAAE,iBAAiB;CAC3B,CAAC;AACX,IAAA,wBAAU,EAAC,6BAAqB,CAAC,CAAC"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Why the read went where it went. The value is a metric label: the dictionary
|
|
3
|
+
* is closed, each reason for going to the primary is named separately, so that "the replicas
|
|
4
|
+
* lag" differs from "the token is broken" and from "could not determine".
|
|
5
5
|
*/
|
|
6
6
|
export declare const ROUTE_REASON: {
|
|
7
|
-
/**
|
|
7
|
+
/** The replica caught up with the token position. */
|
|
8
8
|
readonly replicaCaughtUp: "replica-caught-up";
|
|
9
|
-
/**
|
|
9
|
+
/** Without a token: the replica lag is within the ceiling. */
|
|
10
10
|
readonly replicaWithinLag: "replica-within-lag";
|
|
11
|
-
/**
|
|
11
|
+
/** No replicas are configured. */
|
|
12
12
|
readonly noReplicas: "no-replicas";
|
|
13
|
-
/**
|
|
13
|
+
/** The token does not parse: the wrong form, the wrong signature, too long. */
|
|
14
14
|
readonly tokenInvalid: "token-invalid";
|
|
15
|
-
/**
|
|
15
|
+
/** The token was issued without a position (the position after the write could not be determined). */
|
|
16
16
|
readonly tokenUnresolved: "token-unresolved";
|
|
17
|
-
/**
|
|
17
|
+
/** The token is from another timeline than the primary's: there was a failover. */
|
|
18
18
|
readonly tokenOtherTimeline: "token-other-timeline";
|
|
19
|
-
/**
|
|
19
|
+
/** The token position is ahead of the primary on the same timeline. */
|
|
20
20
|
readonly tokenAheadOfPrimary: "token-ahead-of-primary";
|
|
21
|
-
/**
|
|
21
|
+
/** The token was issued by another cluster (the system identifier did not match). */
|
|
22
22
|
readonly tokenForeign: "token-foreign";
|
|
23
|
-
/**
|
|
23
|
+
/** No replica fitted; why each did not is in `excluded`. */
|
|
24
24
|
readonly noReplicaEligible: "no-replica-eligible";
|
|
25
|
-
/**
|
|
25
|
+
/** Without a token: the primary position or timeline could not be determined. */
|
|
26
26
|
readonly primaryStateUnknown: "primary-state-unknown";
|
|
27
27
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Why the read went where it went. The value is a metric label: the dictionary
|
|
3
|
+
* is closed, each reason for going to the primary is named separately, so that "the replicas
|
|
4
|
+
* lag" differs from "the token is broken" and from "could not determine".
|
|
5
5
|
*/
|
|
6
6
|
export declare const ROUTE_REASON: {
|
|
7
|
-
/**
|
|
7
|
+
/** The replica caught up with the token position. */
|
|
8
8
|
readonly replicaCaughtUp: "replica-caught-up";
|
|
9
|
-
/**
|
|
9
|
+
/** Without a token: the replica lag is within the ceiling. */
|
|
10
10
|
readonly replicaWithinLag: "replica-within-lag";
|
|
11
|
-
/**
|
|
11
|
+
/** No replicas are configured. */
|
|
12
12
|
readonly noReplicas: "no-replicas";
|
|
13
|
-
/**
|
|
13
|
+
/** The token does not parse: the wrong form, the wrong signature, too long. */
|
|
14
14
|
readonly tokenInvalid: "token-invalid";
|
|
15
|
-
/**
|
|
15
|
+
/** The token was issued without a position (the position after the write could not be determined). */
|
|
16
16
|
readonly tokenUnresolved: "token-unresolved";
|
|
17
|
-
/**
|
|
17
|
+
/** The token is from another timeline than the primary's: there was a failover. */
|
|
18
18
|
readonly tokenOtherTimeline: "token-other-timeline";
|
|
19
|
-
/**
|
|
19
|
+
/** The token position is ahead of the primary on the same timeline. */
|
|
20
20
|
readonly tokenAheadOfPrimary: "token-ahead-of-primary";
|
|
21
|
-
/**
|
|
21
|
+
/** The token was issued by another cluster (the system identifier did not match). */
|
|
22
22
|
readonly tokenForeign: "token-foreign";
|
|
23
|
-
/**
|
|
23
|
+
/** No replica fitted; why each did not is in `excluded`. */
|
|
24
24
|
readonly noReplicaEligible: "no-replica-eligible";
|
|
25
|
-
/**
|
|
25
|
+
/** Without a token: the primary position or timeline could not be determined. */
|
|
26
26
|
readonly primaryStateUnknown: "primary-state-unknown";
|
|
27
27
|
};
|
|
28
28
|
//# sourceMappingURL=route-reason.constant.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-reason.constant.d.ts","sourceRoot":"","sources":["../../src/constants/route-reason.constant.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,YAAY;IACvB,
|
|
1
|
+
{"version":3,"file":"route-reason.constant.d.ts","sourceRoot":"","sources":["../../src/constants/route-reason.constant.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,YAAY;IACvB,qDAAqD;;IAErD,8DAA8D;;IAE9D,kCAAkC;;IAElC,+EAA+E;;IAE/E,sGAAsG;;IAEtG,mFAAmF;;IAEnF,uEAAuE;;IAEvE,qFAAqF;;IAErF,4DAA4D;;IAE5D,iFAAiF;;CAEzE,CAAC"}
|
|
@@ -3,30 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ROUTE_REASON = void 0;
|
|
4
4
|
const deep_freeze_1 = require("../deep-freeze");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Why the read went where it went. The value is a metric label: the dictionary
|
|
7
|
+
* is closed, each reason for going to the primary is named separately, so that "the replicas
|
|
8
|
+
* lag" differs from "the token is broken" and from "could not determine".
|
|
9
9
|
*/
|
|
10
10
|
exports.ROUTE_REASON = {
|
|
11
|
-
/**
|
|
11
|
+
/** The replica caught up with the token position. */
|
|
12
12
|
replicaCaughtUp: 'replica-caught-up',
|
|
13
|
-
/**
|
|
13
|
+
/** Without a token: the replica lag is within the ceiling. */
|
|
14
14
|
replicaWithinLag: 'replica-within-lag',
|
|
15
|
-
/**
|
|
15
|
+
/** No replicas are configured. */
|
|
16
16
|
noReplicas: 'no-replicas',
|
|
17
|
-
/**
|
|
17
|
+
/** The token does not parse: the wrong form, the wrong signature, too long. */
|
|
18
18
|
tokenInvalid: 'token-invalid',
|
|
19
|
-
/**
|
|
19
|
+
/** The token was issued without a position (the position after the write could not be determined). */
|
|
20
20
|
tokenUnresolved: 'token-unresolved',
|
|
21
|
-
/**
|
|
21
|
+
/** The token is from another timeline than the primary's: there was a failover. */
|
|
22
22
|
tokenOtherTimeline: 'token-other-timeline',
|
|
23
|
-
/**
|
|
23
|
+
/** The token position is ahead of the primary on the same timeline. */
|
|
24
24
|
tokenAheadOfPrimary: 'token-ahead-of-primary',
|
|
25
|
-
/**
|
|
25
|
+
/** The token was issued by another cluster (the system identifier did not match). */
|
|
26
26
|
tokenForeign: 'token-foreign',
|
|
27
|
-
/**
|
|
27
|
+
/** No replica fitted; why each did not is in `excluded`. */
|
|
28
28
|
noReplicaEligible: 'no-replica-eligible',
|
|
29
|
-
/**
|
|
29
|
+
/** Without a token: the primary position or timeline could not be determined. */
|
|
30
30
|
primaryStateUnknown: 'primary-state-unknown',
|
|
31
31
|
};
|
|
32
32
|
(0, deep_freeze_1.deepFreeze)(exports.ROUTE_REASON);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-reason.constant.js","sourceRoot":"","sources":["../../src/constants/route-reason.constant.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C;;;;GAIG;AACU,QAAA,YAAY,GAAG;IAC1B,
|
|
1
|
+
{"version":3,"file":"route-reason.constant.js","sourceRoot":"","sources":["../../src/constants/route-reason.constant.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C;;;;GAIG;AACU,QAAA,YAAY,GAAG;IAC1B,qDAAqD;IACrD,eAAe,EAAE,mBAAmB;IACpC,8DAA8D;IAC9D,gBAAgB,EAAE,oBAAoB;IACtC,kCAAkC;IAClC,UAAU,EAAE,aAAa;IACzB,+EAA+E;IAC/E,YAAY,EAAE,eAAe;IAC7B,sGAAsG;IACtG,eAAe,EAAE,kBAAkB;IACnC,mFAAmF;IACnF,kBAAkB,EAAE,sBAAsB;IAC1C,uEAAuE;IACvE,mBAAmB,EAAE,wBAAwB;IAC7C,qFAAqF;IACrF,YAAY,EAAE,eAAe;IAC7B,4DAA4D;IAC5D,iBAAiB,EAAE,qBAAqB;IACxC,iFAAiF;IACjF,mBAAmB,EAAE,uBAAuB;CACpC,CAAC;AACX,IAAA,wBAAU,EAAC,oBAAY,CAAC,CAAC"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* `u
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* The token form: `v2.<payload base64url>.<HMAC-SHA256 base64url>`.
|
|
3
|
+
* The payload: `p:<system_identifier>:<timeline>:<X/Y>:<issued, epoch ms>` or
|
|
4
|
+
* `u:<issued, epoch ms>` (the position could not be determined). Longer than the ceiling is a refusal
|
|
5
|
+
* before parsing: the token comes from a client header or cookie, and there is no point in parsing
|
|
6
|
+
* an arbitrary amount. `v1` tokens (without the issue moment) are `invalid`.
|
|
7
7
|
*/
|
|
8
8
|
export declare const TOKEN_FORMAT: {
|
|
9
9
|
readonly VERSION: "v2";
|
|
10
|
-
/**
|
|
10
|
+
/** Domain separation of the signature: the same secret elsewhere does not give a valid signature here. */
|
|
11
11
|
readonly DOMAIN: "pg-replica-sync/token/v2";
|
|
12
12
|
readonly MAX_LENGTH: 256;
|
|
13
13
|
readonly MIN_SECRET_BYTES: 32;
|
|
14
|
-
/**
|
|
14
|
+
/** A key with a lower empirical entropy of the byte histogram (bits for the whole key) is a refusal. */
|
|
15
15
|
readonly MIN_SECRET_HISTOGRAM_BITS: 64;
|
|
16
|
-
/**
|
|
16
|
+
/** A key that deflate compresses to fewer bits is a refusal (a near-repeat). */
|
|
17
17
|
readonly MIN_SECRET_COMPRESSED_BITS: 128;
|
|
18
18
|
/** HMAC-SHA256. */
|
|
19
19
|
readonly MAC_BYTES: 32;
|
|
20
|
-
/**
|
|
20
|
+
/** The tag of a payload with a position. */
|
|
21
21
|
readonly POSITION_TAG: "p";
|
|
22
|
-
/**
|
|
22
|
+
/** The tag of the payload of a token issued without a position. */
|
|
23
23
|
readonly UNRESOLVED_TAG: "u";
|
|
24
|
-
/**
|
|
24
|
+
/** The issue moment: a decimal without leading zeros, no longer than 16 digits (≤ 2⁵³ is checked separately). */
|
|
25
25
|
readonly ISSUED_AT_TEXT: RegExp;
|
|
26
26
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* `u
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* The token form: `v2.<payload base64url>.<HMAC-SHA256 base64url>`.
|
|
3
|
+
* The payload: `p:<system_identifier>:<timeline>:<X/Y>:<issued, epoch ms>` or
|
|
4
|
+
* `u:<issued, epoch ms>` (the position could not be determined). Longer than the ceiling is a refusal
|
|
5
|
+
* before parsing: the token comes from a client header or cookie, and there is no point in parsing
|
|
6
|
+
* an arbitrary amount. `v1` tokens (without the issue moment) are `invalid`.
|
|
7
7
|
*/
|
|
8
8
|
export declare const TOKEN_FORMAT: {
|
|
9
9
|
readonly VERSION: "v2";
|
|
10
|
-
/**
|
|
10
|
+
/** Domain separation of the signature: the same secret elsewhere does not give a valid signature here. */
|
|
11
11
|
readonly DOMAIN: "pg-replica-sync/token/v2";
|
|
12
12
|
readonly MAX_LENGTH: 256;
|
|
13
13
|
readonly MIN_SECRET_BYTES: 32;
|
|
14
|
-
/**
|
|
14
|
+
/** A key with a lower empirical entropy of the byte histogram (bits for the whole key) is a refusal. */
|
|
15
15
|
readonly MIN_SECRET_HISTOGRAM_BITS: 64;
|
|
16
|
-
/**
|
|
16
|
+
/** A key that deflate compresses to fewer bits is a refusal (a near-repeat). */
|
|
17
17
|
readonly MIN_SECRET_COMPRESSED_BITS: 128;
|
|
18
18
|
/** HMAC-SHA256. */
|
|
19
19
|
readonly MAC_BYTES: 32;
|
|
20
|
-
/**
|
|
20
|
+
/** The tag of a payload with a position. */
|
|
21
21
|
readonly POSITION_TAG: "p";
|
|
22
|
-
/**
|
|
22
|
+
/** The tag of the payload of a token issued without a position. */
|
|
23
23
|
readonly UNRESOLVED_TAG: "u";
|
|
24
|
-
/**
|
|
24
|
+
/** The issue moment: a decimal without leading zeros, no longer than 16 digits (≤ 2⁵³ is checked separately). */
|
|
25
25
|
readonly ISSUED_AT_TEXT: RegExp;
|
|
26
26
|
};
|
|
27
27
|
//# sourceMappingURL=token-format.constant.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-format.constant.d.ts","sourceRoot":"","sources":["../../src/constants/token-format.constant.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;IAEvB,
|
|
1
|
+
{"version":3,"file":"token-format.constant.d.ts","sourceRoot":"","sources":["../../src/constants/token-format.constant.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY;;IAEvB,0GAA0G;;;;IAI1G,wGAAwG;;IAExG,gFAAgF;;IAEhF,mBAAmB;;IAEnB,4CAA4C;;IAE5C,mEAAmE;;IAEnE,iHAAiH;;CAEzG,CAAC"}
|
|
@@ -3,29 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TOKEN_FORMAT = void 0;
|
|
4
4
|
const deep_freeze_1 = require("../deep-freeze");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `u
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* The token form: `v2.<payload base64url>.<HMAC-SHA256 base64url>`.
|
|
7
|
+
* The payload: `p:<system_identifier>:<timeline>:<X/Y>:<issued, epoch ms>` or
|
|
8
|
+
* `u:<issued, epoch ms>` (the position could not be determined). Longer than the ceiling is a refusal
|
|
9
|
+
* before parsing: the token comes from a client header or cookie, and there is no point in parsing
|
|
10
|
+
* an arbitrary amount. `v1` tokens (without the issue moment) are `invalid`.
|
|
11
11
|
*/
|
|
12
12
|
exports.TOKEN_FORMAT = {
|
|
13
13
|
VERSION: 'v2',
|
|
14
|
-
/**
|
|
14
|
+
/** Domain separation of the signature: the same secret elsewhere does not give a valid signature here. */
|
|
15
15
|
DOMAIN: 'pg-replica-sync/token/v2',
|
|
16
16
|
MAX_LENGTH: 256,
|
|
17
17
|
MIN_SECRET_BYTES: 32,
|
|
18
|
-
/**
|
|
18
|
+
/** A key with a lower empirical entropy of the byte histogram (bits for the whole key) is a refusal. */
|
|
19
19
|
MIN_SECRET_HISTOGRAM_BITS: 64,
|
|
20
|
-
/**
|
|
20
|
+
/** A key that deflate compresses to fewer bits is a refusal (a near-repeat). */
|
|
21
21
|
MIN_SECRET_COMPRESSED_BITS: 128,
|
|
22
22
|
/** HMAC-SHA256. */
|
|
23
23
|
MAC_BYTES: 32,
|
|
24
|
-
/**
|
|
24
|
+
/** The tag of a payload with a position. */
|
|
25
25
|
POSITION_TAG: 'p',
|
|
26
|
-
/**
|
|
26
|
+
/** The tag of the payload of a token issued without a position. */
|
|
27
27
|
UNRESOLVED_TAG: 'u',
|
|
28
|
-
/**
|
|
28
|
+
/** The issue moment: a decimal without leading zeros, no longer than 16 digits (≤ 2⁵³ is checked separately). */
|
|
29
29
|
ISSUED_AT_TEXT: /^(0|[1-9][0-9]{0,15})$/,
|
|
30
30
|
};
|
|
31
31
|
(0, deep_freeze_1.deepFreeze)(exports.TOKEN_FORMAT);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-format.constant.js","sourceRoot":"","sources":["../../src/constants/token-format.constant.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C;;;;;;GAMG;AACU,QAAA,YAAY,GAAG;IAC1B,OAAO,EAAE,IAAI;IACb,
|
|
1
|
+
{"version":3,"file":"token-format.constant.js","sourceRoot":"","sources":["../../src/constants/token-format.constant.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C;;;;;;GAMG;AACU,QAAA,YAAY,GAAG;IAC1B,OAAO,EAAE,IAAI;IACb,0GAA0G;IAC1G,MAAM,EAAE,0BAA0B;IAClC,UAAU,EAAE,GAAG;IACf,gBAAgB,EAAE,EAAE;IACpB,wGAAwG;IACxG,yBAAyB,EAAE,EAAE;IAC7B,gFAAgF;IAChF,0BAA0B,EAAE,GAAG;IAC/B,mBAAmB;IACnB,SAAS,EAAE,EAAE;IACb,4CAA4C;IAC5C,YAAY,EAAE,GAAG;IACjB,mEAAmE;IACnE,cAAc,EAAE,GAAG;IACnB,iHAAiH;IACjH,cAAc,EAAE,wBAAwB;CAChC,CAAC;AACX,IAAA,wBAAU,EAAC,oBAAY,CAAC,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** The forms of Postgres values that the package parses. Without the g flag: the regular expressions are shared. */
|
|
2
2
|
export declare const WAL_FORMAT: {
|
|
3
|
-
/** `pg_lsn`
|
|
3
|
+
/** `pg_lsn` in text: `X/Y`, 1–8 hexadecimal digits each. */
|
|
4
4
|
readonly LSN_TEXT: RegExp;
|
|
5
|
-
/**
|
|
5
|
+
/** A WAL file name: 8 digits of the timeline + 16 digits of the segment. */
|
|
6
6
|
readonly WAL_FILE: RegExp;
|
|
7
|
-
/** `system_identifier`
|
|
7
|
+
/** `system_identifier` is a uint64 in decimal notation. */
|
|
8
8
|
readonly SYSTEM_ID: RegExp;
|
|
9
|
-
/**
|
|
9
|
+
/** The timeline in a token: a decimal without leading zeros. */
|
|
10
10
|
readonly TIMELINE_TEXT: RegExp;
|
|
11
11
|
readonly MAX_TIMELINE: 4294967295;
|
|
12
12
|
readonly MAX_LSN: bigint;
|
|
13
|
-
/** `pg_get_wal_replay_pause_state()`
|
|
13
|
+
/** `pg_get_wal_replay_pause_state()` outside a pause; any other value is a pause. */
|
|
14
14
|
readonly NOT_PAUSED: "not paused";
|
|
15
15
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** The forms of Postgres values that the package parses. Without the g flag: the regular expressions are shared. */
|
|
2
2
|
export declare const WAL_FORMAT: {
|
|
3
|
-
/** `pg_lsn`
|
|
3
|
+
/** `pg_lsn` in text: `X/Y`, 1–8 hexadecimal digits each. */
|
|
4
4
|
readonly LSN_TEXT: RegExp;
|
|
5
|
-
/**
|
|
5
|
+
/** A WAL file name: 8 digits of the timeline + 16 digits of the segment. */
|
|
6
6
|
readonly WAL_FILE: RegExp;
|
|
7
|
-
/** `system_identifier`
|
|
7
|
+
/** `system_identifier` is a uint64 in decimal notation. */
|
|
8
8
|
readonly SYSTEM_ID: RegExp;
|
|
9
|
-
/**
|
|
9
|
+
/** The timeline in a token: a decimal without leading zeros. */
|
|
10
10
|
readonly TIMELINE_TEXT: RegExp;
|
|
11
11
|
readonly MAX_TIMELINE: 4294967295;
|
|
12
12
|
readonly MAX_LSN: bigint;
|
|
13
|
-
/** `pg_get_wal_replay_pause_state()`
|
|
13
|
+
/** `pg_get_wal_replay_pause_state()` outside a pause; any other value is a pause. */
|
|
14
14
|
readonly NOT_PAUSED: "not paused";
|
|
15
15
|
};
|
|
16
16
|
//# sourceMappingURL=wal-format.constant.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wal-format.constant.d.ts","sourceRoot":"","sources":["../../src/constants/wal-format.constant.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"wal-format.constant.d.ts","sourceRoot":"","sources":["../../src/constants/wal-format.constant.ts"],"names":[],"mappings":"AAEA,oHAAoH;AACpH,eAAO,MAAM,UAAU;IACrB,4DAA4D;;IAE5D,4EAA4E;;IAE5E,2DAA2D;;IAE3D,gEAAgE;;;;IAIhE,qFAAqF;;CAE7E,CAAC"}
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WAL_FORMAT = void 0;
|
|
4
4
|
const deep_freeze_1 = require("../deep-freeze");
|
|
5
|
-
/**
|
|
5
|
+
/** The forms of Postgres values that the package parses. Without the g flag: the regular expressions are shared. */
|
|
6
6
|
exports.WAL_FORMAT = {
|
|
7
|
-
/** `pg_lsn`
|
|
7
|
+
/** `pg_lsn` in text: `X/Y`, 1–8 hexadecimal digits each. */
|
|
8
8
|
LSN_TEXT: /^([0-9A-Fa-f]{1,8})\/([0-9A-Fa-f]{1,8})$/,
|
|
9
|
-
/**
|
|
9
|
+
/** A WAL file name: 8 digits of the timeline + 16 digits of the segment. */
|
|
10
10
|
WAL_FILE: /^([0-9A-F]{8})[0-9A-F]{16}$/,
|
|
11
|
-
/** `system_identifier`
|
|
11
|
+
/** `system_identifier` is a uint64 in decimal notation. */
|
|
12
12
|
SYSTEM_ID: /^[0-9]{1,20}$/,
|
|
13
|
-
/**
|
|
13
|
+
/** The timeline in a token: a decimal without leading zeros. */
|
|
14
14
|
TIMELINE_TEXT: /^[1-9][0-9]{0,9}$/,
|
|
15
15
|
MAX_TIMELINE: 0xffffffff,
|
|
16
16
|
MAX_LSN: (1n << 64n) - 1n,
|
|
17
|
-
/** `pg_get_wal_replay_pause_state()`
|
|
17
|
+
/** `pg_get_wal_replay_pause_state()` outside a pause; any other value is a pause. */
|
|
18
18
|
NOT_PAUSED: 'not paused',
|
|
19
19
|
};
|
|
20
20
|
(0, deep_freeze_1.deepFreeze)(exports.WAL_FORMAT);
|