@rocicorp/zero 1.12.0-canary.6 → 1.12.0-canary.7
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/out/zero/package.js +10 -10
- package/out/zero/package.js.map +1 -1
- package/out/zero-cache/src/auth/write-authorizer.js +9 -2
- package/out/zero-cache/src/auth/write-authorizer.js.map +1 -1
- package/out/zero-cache/src/server/change-streamer.js +1 -0
- package/out/zero-cache/src/server/change-streamer.js.map +1 -1
- package/out/zero-cache/src/services/change-source/common/replica-restore.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/change-source-init.js +17 -9
- package/out/zero-cache/src/services/change-source/pg/change-source-init.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/server-start-metrics.js +1 -1
- package/out/zero-cache/src/services/change-streamer/server-start-metrics.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.js +1 -2
- package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.js +19 -2
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-client/src/client/version.js +1 -1
- package/out/zero-protocol/src/inspect-down.d.ts +81 -81
- package/out/zero-protocol/src/up.d.ts +60 -60
- package/package.json +10 -10
- package/out/shared/src/cache.d.ts +0 -22
- package/out/shared/src/cache.d.ts.map +0 -1
- package/out/shared/src/custom-key-map.d.ts +0 -26
- package/out/shared/src/custom-key-map.d.ts.map +0 -1
- package/out/shared/src/custom-key-set.d.ts +0 -25
- package/out/shared/src/custom-key-set.d.ts.map +0 -1
- package/out/shared/src/logging-test-utils.d.ts +0 -12
- package/out/shared/src/logging-test-utils.d.ts.map +0 -1
- package/out/shared/src/queue.d.ts +0 -53
- package/out/shared/src/queue.d.ts.map +0 -1
- package/out/shared/src/ring-buffer.d.ts +0 -42
- package/out/shared/src/ring-buffer.d.ts.map +0 -1
- package/out/shared/src/sorted-entries.d.ts +0 -2
- package/out/shared/src/sorted-entries.d.ts.map +0 -1
- package/out/zero/src/server/change-streamer.d.ts +0 -2
- package/out/zero/src/server/change-streamer.d.ts.map +0 -1
- package/out/zero/src/server/main.d.ts +0 -2
- package/out/zero/src/server/main.d.ts.map +0 -1
- package/out/zero/src/server/reaper.d.ts +0 -2
- package/out/zero/src/server/reaper.d.ts.map +0 -1
- package/out/zero/src/server/replicator.d.ts +0 -2
- package/out/zero/src/server/replicator.d.ts.map +0 -1
- package/out/zero/src/server/syncer.d.ts +0 -2
- package/out/zero/src/server/syncer.d.ts.map +0 -1
- package/out/zero-cache/src/auth/jwt.d.ts +0 -12
- package/out/zero-cache/src/auth/jwt.d.ts.map +0 -1
- package/out/zero-cache/src/auth/load-permissions.d.ts +0 -17
- package/out/zero-cache/src/auth/load-permissions.d.ts.map +0 -1
- package/out/zero-cache/src/auth/write-authorizer.d.ts +0 -28
- package/out/zero-cache/src/auth/write-authorizer.d.ts.map +0 -1
- package/out/zero-cache/src/config/server-context.d.ts +0 -16
- package/out/zero-cache/src/config/server-context.d.ts.map +0 -1
- package/out/zero-cache/src/custom/fetch.d.ts +0 -38
- package/out/zero-cache/src/custom/fetch.d.ts.map +0 -1
- package/out/zero-cache/src/custom/metrics.d.ts +0 -31
- package/out/zero-cache/src/custom/metrics.d.ts.map +0 -1
- package/out/zero-cache/src/custom-queries/transform-query.d.ts +0 -68
- package/out/zero-cache/src/custom-queries/transform-query.d.ts.map +0 -1
- package/out/zero-cache/src/db/create.d.ts +0 -12
- package/out/zero-cache/src/db/create.d.ts.map +0 -1
- package/out/zero-cache/src/db/delete-lite-db.d.ts +0 -2
- package/out/zero-cache/src/db/delete-lite-db.d.ts.map +0 -1
- package/out/zero-cache/src/db/index-predicate.d.ts +0 -4
- package/out/zero-cache/src/db/index-predicate.d.ts.map +0 -1
- package/out/zero-cache/src/db/migration-lite.d.ts +0 -78
- package/out/zero-cache/src/db/migration-lite.d.ts.map +0 -1
- package/out/zero-cache/src/db/migration.d.ts +0 -80
- package/out/zero-cache/src/db/migration.d.ts.map +0 -1
- package/out/zero-cache/src/db/pg-copy-binary.d.ts +0 -101
- package/out/zero-cache/src/db/pg-copy-binary.d.ts.map +0 -1
- package/out/zero-cache/src/db/pg-copy.d.ts +0 -30
- package/out/zero-cache/src/db/pg-copy.d.ts.map +0 -1
- package/out/zero-cache/src/db/pg-type-parser.d.ts +0 -15
- package/out/zero-cache/src/db/pg-type-parser.d.ts.map +0 -1
- package/out/zero-cache/src/db/transaction-pool.d.ts +0 -205
- package/out/zero-cache/src/db/transaction-pool.d.ts.map +0 -1
- package/out/zero-cache/src/db/warmup.d.ts +0 -4
- package/out/zero-cache/src/db/warmup.d.ts.map +0 -1
- package/out/zero-cache/src/observability/events.d.ts +0 -15
- package/out/zero-cache/src/observability/events.d.ts.map +0 -1
- package/out/zero-cache/src/observability/log-throttle.d.ts +0 -44
- package/out/zero-cache/src/observability/log-throttle.d.ts.map +0 -1
- package/out/zero-cache/src/server/anonymous-otel-start.d.ts +0 -21
- package/out/zero-cache/src/server/anonymous-otel-start.d.ts.map +0 -1
- package/out/zero-cache/src/server/change-streamer.d.ts +0 -3
- package/out/zero-cache/src/server/change-streamer.d.ts.map +0 -1
- package/out/zero-cache/src/server/inspector-delegate.d.ts +0 -71
- package/out/zero-cache/src/server/inspector-delegate.d.ts.map +0 -1
- package/out/zero-cache/src/server/main.d.ts +0 -3
- package/out/zero-cache/src/server/main.d.ts.map +0 -1
- package/out/zero-cache/src/server/otel-diag-logger.d.ts +0 -16
- package/out/zero-cache/src/server/otel-diag-logger.d.ts.map +0 -1
- package/out/zero-cache/src/server/otel-start.d.ts +0 -3
- package/out/zero-cache/src/server/otel-start.d.ts.map +0 -1
- package/out/zero-cache/src/server/priority-op.d.ts +0 -8
- package/out/zero-cache/src/server/priority-op.d.ts.map +0 -1
- package/out/zero-cache/src/server/reaper.d.ts +0 -3
- package/out/zero-cache/src/server/reaper.d.ts.map +0 -1
- package/out/zero-cache/src/server/replicator.d.ts +0 -10
- package/out/zero-cache/src/server/replicator.d.ts.map +0 -1
- package/out/zero-cache/src/server/slot-keeper.d.ts +0 -26
- package/out/zero-cache/src/server/slot-keeper.d.ts.map +0 -1
- package/out/zero-cache/src/server/syncer-assigner.d.ts +0 -14
- package/out/zero-cache/src/server/syncer-assigner.d.ts.map +0 -1
- package/out/zero-cache/src/server/syncer.d.ts +0 -3
- package/out/zero-cache/src/server/syncer.d.ts.map +0 -1
- package/out/zero-cache/src/server/worker-dispatcher.d.ts +0 -17
- package/out/zero-cache/src/server/worker-dispatcher.d.ts.map +0 -1
- package/out/zero-cache/src/services/analyze.d.ts +0 -9
- package/out/zero-cache/src/services/analyze.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/change-source.d.ts +0 -39
- package/out/zero-cache/src/services/change-source/change-source.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts +0 -57
- package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts +0 -55
- package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts +0 -24
- package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts +0 -140
- package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts +0 -14
- package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/custom/change-source.d.ts +0 -25
- package/out/zero-cache/src/services/change-source/custom/change-source.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts +0 -14
- package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts +0 -36
- package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts +0 -72
- package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/change-source.d.ts +0 -127
- package/out/zero-cache/src/services/change-source/pg/change-source.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/fork-request.d.ts +0 -57
- package/out/zero-cache/src/services/change-source/pg/fork-request.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts +0 -155
- package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts +0 -17
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts +0 -28
- package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts +0 -76
- package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts +0 -169
- package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts +0 -16
- package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts +0 -15
- package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts +0 -127
- package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts +0 -9
- package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts +0 -68
- package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts +0 -72
- package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts +0 -50
- package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts +0 -12
- package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts +0 -57
- package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/broadcast.d.ts +0 -98
- package/out/zero-cache/src/services/change-streamer/broadcast.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts +0 -34
- package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts +0 -34
- package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts +0 -158
- package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts +0 -19
- package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts +0 -78
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts +0 -152
- package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts +0 -575
- package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts +0 -24
- package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts +0 -15
- package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/forwarder.d.ts +0 -49
- package/out/zero-cache/src/services/change-streamer/forwarder.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts +0 -80
- package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts +0 -88
- package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts +0 -15
- package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts +0 -243
- package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/schema/init.d.ts +0 -6
- package/out/zero-cache/src/services/change-streamer/schema/init.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts +0 -152
- package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/server-start-metrics.d.ts +0 -33
- package/out/zero-cache/src/services/change-streamer/server-start-metrics.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts +0 -11
- package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts +0 -92
- package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts +0 -36
- package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/snapshot.d.ts +0 -22
- package/out/zero-cache/src/services/change-streamer/snapshot.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts +0 -99
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts +0 -83
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts +0 -121
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts +0 -73
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts +0 -62
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts +0 -114
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/storer.d.ts +0 -276
- package/out/zero-cache/src/services/change-streamer/storer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/subscribe.d.ts +0 -485
- package/out/zero-cache/src/services/change-streamer/subscribe.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/subscriber.d.ts +0 -205
- package/out/zero-cache/src/services/change-streamer/subscriber.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts +0 -52
- package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts.map +0 -1
- package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts +0 -57
- package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts.map +0 -1
- package/out/zero-cache/src/services/litestream/commands.d.ts +0 -77
- package/out/zero-cache/src/services/litestream/commands.d.ts.map +0 -1
- package/out/zero-cache/src/services/litestream/litestream-controller.d.ts +0 -78
- package/out/zero-cache/src/services/litestream/litestream-controller.d.ts.map +0 -1
- package/out/zero-cache/src/services/litestream/metrics.d.ts +0 -31
- package/out/zero-cache/src/services/litestream/metrics.d.ts.map +0 -1
- package/out/zero-cache/src/services/litestream/restore-progress.d.ts +0 -24
- package/out/zero-cache/src/services/litestream/restore-progress.d.ts.map +0 -1
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts +0 -40
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +0 -1
- package/out/zero-cache/src/services/mutagen/pusher.d.ts +0 -63
- package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/change-log-db.d.ts +0 -368
- package/out/zero-cache/src/services/replicator/change-log-db.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts +0 -56
- package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/change-processor.d.ts +0 -37
- package/out/zero-cache/src/services/replicator/change-processor.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/drain-handler.d.ts +0 -82
- package/out/zero-cache/src/services/replicator/drain-handler.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/incremental-sync.d.ts +0 -25
- package/out/zero-cache/src/services/replicator/incremental-sync.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/notifier.d.ts +0 -9
- package/out/zero-cache/src/services/replicator/notifier.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/replication-status.d.ts +0 -71
- package/out/zero-cache/src/services/replicator/replication-status.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/replicator.d.ts +0 -86
- package/out/zero-cache/src/services/replicator/replicator.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts +0 -55
- package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts +0 -132
- package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts +0 -120
- package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/write-worker-client.d.ts +0 -111
- package/out/zero-cache/src/services/replicator/write-worker-client.d.ts.map +0 -1
- package/out/zero-cache/src/services/run-ast.d.ts +0 -39
- package/out/zero-cache/src/services/run-ast.d.ts.map +0 -1
- package/out/zero-cache/src/services/runner.d.ts +0 -19
- package/out/zero-cache/src/services/runner.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts +0 -17
- package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts +0 -26
- package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts +0 -79
- package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +0 -97
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/client-schema.d.ts +0 -18
- package/out/zero-cache/src/services/view-syncer/client-schema.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts +0 -184
- package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts +0 -22
- package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +0 -128
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts +0 -294
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts +0 -81
- package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts +0 -45
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts +0 -53
- package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts +0 -33
- package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts +0 -51
- package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts +0 -34
- package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts +0 -296
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts +0 -7
- package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/push-cost.d.ts +0 -132
- package/out/zero-cache/src/services/view-syncer/push-cost.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts +0 -55
- package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/query-covering.d.ts +0 -28
- package/out/zero-cache/src/services/view-syncer/query-covering.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/query-shape.d.ts +0 -25
- package/out/zero-cache/src/services/view-syncer/query-shape.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/query-stats.d.ts +0 -89
- package/out/zero-cache/src/services/view-syncer/query-stats.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts +0 -90
- package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts +0 -17
- package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts +0 -86
- package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/schema/init.d.ts +0 -5
- package/out/zero-cache/src/services/view-syncer/schema/init.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +0 -563
- package/out/zero-cache/src/services/view-syncer/schema/types.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts +0 -95
- package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts +0 -420
- package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/tracer.d.ts +0 -2
- package/out/zero-cache/src/services/view-syncer/tracer.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts +0 -10
- package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +0 -133
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +0 -1
- package/out/zero-cache/src/types/downstream.d.ts +0 -11
- package/out/zero-cache/src/types/downstream.d.ts.map +0 -1
- package/out/zero-cache/src/types/error-with-level.d.ts +0 -9
- package/out/zero-cache/src/types/error-with-level.d.ts.map +0 -1
- package/out/zero-cache/src/types/pg-patch.d.ts +0 -21
- package/out/zero-cache/src/types/pg-patch.d.ts.map +0 -1
- package/out/zero-cache/src/types/pg-versions.d.ts +0 -3
- package/out/zero-cache/src/types/pg-versions.d.ts.map +0 -1
- package/out/zero-cache/src/types/poke-chunk.d.ts +0 -18
- package/out/zero-cache/src/types/poke-chunk.d.ts.map +0 -1
- package/out/zero-cache/src/types/streams.d.ts +0 -115
- package/out/zero-cache/src/types/streams.d.ts.map +0 -1
- package/out/zero-cache/src/types/subscription.d.ts +0 -197
- package/out/zero-cache/src/types/subscription.d.ts.map +0 -1
- package/out/zero-cache/src/workers/connect-params.d.ts +0 -28
- package/out/zero-cache/src/workers/connect-params.d.ts.map +0 -1
- package/out/zero-cache/src/workers/connection.d.ts +0 -77
- package/out/zero-cache/src/workers/connection.d.ts.map +0 -1
- package/out/zero-cache/src/workers/replicator.d.ts +0 -57
- package/out/zero-cache/src/workers/replicator.d.ts.map +0 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts +0 -14
- package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts.map +0 -1
- package/out/zero-cache/src/workers/syncer.d.ts +0 -67
- package/out/zero-cache/src/workers/syncer.d.ts.map +0 -1
- package/out/zero-events/src/index.d.ts +0 -27
- package/out/zero-events/src/index.d.ts.map +0 -1
- package/out/zero-events/src/json.d.ts +0 -20
- package/out/zero-events/src/json.d.ts.map +0 -1
- package/out/zero-events/src/status.d.ts +0 -144
- package/out/zero-events/src/status.d.ts.map +0 -1
- package/out/zqlite/src/database-storage.d.ts +0 -43
- package/out/zqlite/src/database-storage.d.ts.map +0 -1
- package/out/zqlite/src/explain-queries.d.ts +0 -4
- package/out/zqlite/src/explain-queries.d.ts.map +0 -1
- package/out/zqlite/src/internal/sql-inline.d.ts +0 -13
- package/out/zqlite/src/internal/sql-inline.d.ts.map +0 -1
- package/out/zqlite/src/resolve-scalar-subqueries.d.ts +0 -72
- package/out/zqlite/src/resolve-scalar-subqueries.d.ts.map +0 -1
- package/out/zqlite/src/sqlite-cost-model.d.ts +0 -17
- package/out/zqlite/src/sqlite-cost-model.d.ts.map +0 -1
- package/out/zqlite/src/sqlite-stat-fanout.d.ts +0 -121
- package/out/zqlite/src/sqlite-stat-fanout.d.ts.map +0 -1
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { Readable } from 'node:stream';
|
|
2
|
-
import type { LogContext } from '@rocicorp/logger';
|
|
3
|
-
import postgres from 'postgres';
|
|
4
|
-
import type { SlotKeeperConfig } from '../../../../server/slot-keeper.ts';
|
|
5
|
-
import { type PostgresDB } from '../../../../types/pg.ts';
|
|
6
|
-
import { type Worker } from '../../../../types/processes.ts';
|
|
7
|
-
import { type Sink, type Source } from '../../../../types/streams.ts';
|
|
8
|
-
import type { Message } from './pgoutput.types.ts';
|
|
9
|
-
export declare const DEFAULT_RETRIES_IF_REPLICATION_SLOT_ACTIVE = 5;
|
|
10
|
-
export type StreamMessage = [
|
|
11
|
-
lsn: bigint,
|
|
12
|
-
Message | {
|
|
13
|
-
tag: 'keepalive';
|
|
14
|
-
shouldRespond: boolean;
|
|
15
|
-
}
|
|
16
|
-
];
|
|
17
|
-
type SourceWithPendingQueue<T> = Source<T> & {
|
|
18
|
-
queued: number;
|
|
19
|
-
};
|
|
20
|
-
export declare function createReplicationSessionFor(db: PostgresDB, applicationName: string): postgres.Sql<{}>;
|
|
21
|
-
export declare function subscribe(lc: LogContext, db: PostgresDB, slot: string, publications: string[], lsn: bigint, retriesIfReplicationSlotActive?: number, applicationName?: string, inboundTimeoutOverrideMs?: number | undefined): Promise<{
|
|
22
|
-
messages: SourceWithPendingQueue<StreamMessage>;
|
|
23
|
-
acks: Sink<bigint>;
|
|
24
|
-
}>;
|
|
25
|
-
/**
|
|
26
|
-
* Measures how long upstream takes to decode the WAL between the slot's
|
|
27
|
-
* `restart_lsn` and the start of the stream, during which the stream
|
|
28
|
-
* delivers nothing but keepalives. This span can be large, e.g. for a slot
|
|
29
|
-
* that was created (or last acked) long before the requested start LSN.
|
|
30
|
-
*
|
|
31
|
-
* The walsender streams from `max(lsn, confirmed_flush_lsn)`, but must
|
|
32
|
-
* decode from `restart_lsn` to rebuild its transaction state. The decode is
|
|
33
|
-
* considered complete upon the first message at or past the start:
|
|
34
|
-
* * any XLogData message, since only transactions committed after the
|
|
35
|
-
* start are sent, or
|
|
36
|
-
* * a keepalive at or past the start. Keepalives report the decoding
|
|
37
|
-
* position, except for the first one of the stream, which reports the
|
|
38
|
-
* slot's `confirmed_flush_lsn` and is thus ignored if it is at or past the
|
|
39
|
-
* start.
|
|
40
|
-
*
|
|
41
|
-
* Note that on an idle upstream, a walsender whose start is already
|
|
42
|
-
* confirmed may not send a keepalive until other WAL is written or the
|
|
43
|
-
* periodic keepalive (`wal_sender_timeout / 2`) is due, so the measured
|
|
44
|
-
* time is an upper bound when completed by a keepalive.
|
|
45
|
-
*/
|
|
46
|
-
export declare class InitialDecodeTracker {
|
|
47
|
-
#private;
|
|
48
|
-
static start(lc: LogContext, session: postgres.Sql, slot: string, lsn: bigint): Promise<InitialDecodeTracker>;
|
|
49
|
-
constructor(lc: LogContext, lsn: bigint, restartLSN: bigint | undefined, confirmedFlushLSN: bigint | undefined, startTime: number);
|
|
50
|
-
/**
|
|
51
|
-
* Observes a received message, returning the elapsed decode time (ms) if
|
|
52
|
-
* this message completed the initial decode.
|
|
53
|
-
*/
|
|
54
|
-
observe([lsn, msg]: StreamMessage, now: number): number | undefined;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Derives the timings for the replication liveness timer from the server's
|
|
58
|
-
* `wal_sender_timeout` (in milliseconds).
|
|
59
|
-
*
|
|
60
|
-
* Postgres treats `wal_sender_timeout = 0` as "disabled": it will neither
|
|
61
|
-
* terminate an idle wal sender nor emit the periodic keepalives it otherwise
|
|
62
|
-
* sends at roughly `wal_sender_timeout / 2`. Every timing below is derived from
|
|
63
|
-
* that interval, so a disabled timeout disables the liveness machinery entirely
|
|
64
|
-
* (`enabled: false`). Otherwise the derived thresholds would all collapse to 0,
|
|
65
|
-
* inverting the intended meaning: the inbound watchdog would fire on the very
|
|
66
|
-
* first tick and destroy the stream, while the timer itself would busy-spin at
|
|
67
|
-
* a 0ms interval — together producing a continuous reconnect storm.
|
|
68
|
-
*
|
|
69
|
-
* An `inboundTimeoutOverrideMs` (when positive) replaces the default
|
|
70
|
-
* `2x wal_sender_timeout` inbound threshold. The two timeouts protect
|
|
71
|
-
* different parties with asymmetric false-positive costs: `wal_sender_timeout`
|
|
72
|
-
* is the server reaping dead clients (a false positive there costs a cheap
|
|
73
|
-
* reconnect), while the inbound watchdog tears down the stream and replays the
|
|
74
|
-
* in-flight transaction — expensive, and self-defeating when the wal sender is
|
|
75
|
-
* legitimately silent for long stretches (e.g. decoding through WAL from
|
|
76
|
-
* unpublished tables, or assembling a large transaction that pgoutput only
|
|
77
|
-
* sends at commit). Operators who don't own the server setting (e.g. managed
|
|
78
|
-
* or operator-provisioned Postgres with an aggressive cluster-wide
|
|
79
|
-
* `wal_sender_timeout`) can widen the client-side fuse independently.
|
|
80
|
-
*
|
|
81
|
-
* The override has no effect when `wal_sender_timeout` is disabled (0): the
|
|
82
|
-
* server then sends no periodic keepalives, so inbound silence is normal even
|
|
83
|
-
* on an idle healthy connection and any silence-based watchdog would
|
|
84
|
-
* false-positive.
|
|
85
|
-
*
|
|
86
|
-
* https://www.postgresql.org/docs/current/runtime-config-replication.html#GUC-WAL-SENDER-TIMEOUT
|
|
87
|
-
*/
|
|
88
|
-
export declare function computeLivenessTimings(walSenderTimeoutMs: number, inboundTimeoutOverrideMs?: number | undefined): {
|
|
89
|
-
enabled: boolean;
|
|
90
|
-
manualKeepaliveTimeout: number;
|
|
91
|
-
inboundTimeoutMs: number;
|
|
92
|
-
timerIntervalMs: number;
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* Pure decision for the inbound-liveness watchdog, given the time since the
|
|
96
|
-
* last inbound message, the timeout threshold, and the number of messages
|
|
97
|
-
* currently queued downstream (see {@link SourceWithPendingQueue.queued}).
|
|
98
|
-
*
|
|
99
|
-
* A non-empty downstream queue means we have received data we haven't yet
|
|
100
|
-
* consumed: the reason we aren't receiving *more* is our own back-pressure, not
|
|
101
|
-
* upstream silence. In that case we `resetWindow` (treat the backlog as
|
|
102
|
-
* liveness evidence) rather than counting the stall against the connection.
|
|
103
|
-
* This both suppresses false timeouts during back-pressure and — crucially —
|
|
104
|
-
* keeps `lastReceivedTime` fresh so the drain transition (queue emptying after
|
|
105
|
-
* a long stall) doesn't fire the watchdog against a stale timestamp on the very
|
|
106
|
-
* next tick.
|
|
107
|
-
*
|
|
108
|
-
* Only when the queue is empty (consumption has caught up, so reading — and
|
|
109
|
-
* thus keepalives — should be flowing again) does an over-threshold gap
|
|
110
|
-
* indicate a genuinely dead inbound half.
|
|
111
|
-
*/
|
|
112
|
-
export declare function evaluateInboundLiveness({ sinceLastReceived, inboundTimeoutMs, queued, }: {
|
|
113
|
-
sinceLastReceived: number;
|
|
114
|
-
inboundTimeoutMs: number;
|
|
115
|
-
queued: number;
|
|
116
|
-
}): {
|
|
117
|
-
resetWindow: boolean;
|
|
118
|
-
timedOut: boolean;
|
|
119
|
-
};
|
|
120
|
-
export declare function startReplicationStream(lc: LogContext, session: postgres.Sql, slot: string, publications: string[], lsn: bigint, maxAttempts?: number): Promise<[Readable, import("stream").Writable]>;
|
|
121
|
-
/**
|
|
122
|
-
* Starts a "dummy" replication session for the specified `slot` which:
|
|
123
|
-
* * does not consume any records
|
|
124
|
-
* * keeps the session alive by sending status messages at the starting LSN
|
|
125
|
-
*
|
|
126
|
-
* This essentially reserves the replication slot for this process by marking
|
|
127
|
-
* it as "active" in pg_replication_slots, allowing replication slot cleanup
|
|
128
|
-
* logic to distinguish a new-but-initializing replication slot from one that
|
|
129
|
-
* has been abandoned / orphaned.
|
|
130
|
-
*
|
|
131
|
-
* When initialization (e.g. initial-sync) has finished, the server should take
|
|
132
|
-
* over the replication slot using pg_terminate_backend, which will close the
|
|
133
|
-
* session.
|
|
134
|
-
*
|
|
135
|
-
* Note that caller should not close the supplied `session`, as that will
|
|
136
|
-
* also terminate the dummy replication session.
|
|
137
|
-
*/
|
|
138
|
-
export declare class SlotReservationHandle extends Readable {
|
|
139
|
-
#private;
|
|
140
|
-
constructor(worker: Worker);
|
|
141
|
-
_destroy(error: Error | null, callback: (error?: Error | null) => void): void;
|
|
142
|
-
end(timeoutMs?: number): Promise<void>;
|
|
143
|
-
}
|
|
144
|
-
export declare function endSession(session?: Readable): Promise<void>;
|
|
145
|
-
export type PgConnectionConfig = {
|
|
146
|
-
host?: string | string[] | undefined;
|
|
147
|
-
port?: number | number[] | undefined;
|
|
148
|
-
path?: string | undefined;
|
|
149
|
-
database?: string | undefined;
|
|
150
|
-
user?: string | undefined;
|
|
151
|
-
pass?: string | null | undefined;
|
|
152
|
-
ssl?: boolean | string | {
|
|
153
|
-
rejectUnauthorized?: boolean | undefined;
|
|
154
|
-
} | undefined;
|
|
155
|
-
};
|
|
156
|
-
export declare function extractConnectionConfig(session: postgres.Sql): PgConnectionConfig;
|
|
157
|
-
/**
|
|
158
|
-
* Starts a "dummy" replication session for the specified `slot` which:
|
|
159
|
-
* * does not consume any records
|
|
160
|
-
* * keeps the session alive by sending status messages at the starting LSN
|
|
161
|
-
*
|
|
162
|
-
* Runs in a separate process with its own event loop and connection reconnect
|
|
163
|
-
* loop to prevent slot drop races during heavy initial sync table copy or
|
|
164
|
-
* SQLite index building.
|
|
165
|
-
*/
|
|
166
|
-
export declare function keepSlotActiveUntilTakenOver(lc: LogContext, config: SlotKeeperConfig): Promise<Readable>;
|
|
167
|
-
export declare function makeAck(lsn: bigint): Buffer;
|
|
168
|
-
export {};
|
|
169
|
-
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../../../../../../zero-cache/src/services/change-source/pg/logical-replication/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AAMrC,O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|
2
|
-
import type { PostgresDB } from '../../../types/pg.ts';
|
|
3
|
-
import type { ShardID } from '../../../types/shards.ts';
|
|
4
|
-
type Options = {
|
|
5
|
-
inactiveSlotCleanupTimeoutMs?: number | undefined;
|
|
6
|
-
pollIntervalMs?: number | undefined;
|
|
7
|
-
};
|
|
8
|
-
export declare class ReplicationSlotCleanupMonitor {
|
|
9
|
-
#private;
|
|
10
|
-
constructor(lc: LogContext, shard: ShardID, upstream: PostgresDB, upstreamPgServerVersionNum: number, currentSlot: string, { inactiveSlotCleanupTimeoutMs, pollIntervalMs }?: Options);
|
|
11
|
-
start(): void;
|
|
12
|
-
stop(): void;
|
|
13
|
-
getSlotsToCleanup(now: Date): Promise<string[]>;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=replication-slot-cleanup-monitor.d.ts.map
|
package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replication-slot-cleanup-monitor.d.ts","sourceRoot":"","sources":["../../../../../../../zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAC;AAItD,KAAK,OAAO,GAAG;IACb,4BAA4B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClD,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC,CAAC;AAKF,qBAAa,6BAA6B;;IAkCxC,YACE,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,UAAU,EACpB,0BAA0B,EAAE,MAAM,EAClC,WAAW,EAAE,MAAM,EACnB,EAAC,4BAA4B,EAAE,cAAc,EAAC,GAAE,OAAY,EAW7D;IAED,KAAK,SAYJ;IAED,IAAI,SAIH;IAiBK,iBAAiB,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAqEpD;CACF"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { LogContext } from '@rocicorp/logger';
|
|
2
|
-
import type { PostgresDB } from '../../../types/pg.ts';
|
|
3
|
-
declare const SLOT_HEALTH_STATUSES: readonly ['ok', 'unreserved', 'lost', 'missing', 'unknown'];
|
|
4
|
-
export type SlotHealthStatus = (typeof SLOT_HEALTH_STATUSES)[number];
|
|
5
|
-
export type SlotHealthRow = {
|
|
6
|
-
readonly restartLSN: string | null;
|
|
7
|
-
readonly walStatus: string | null;
|
|
8
|
-
readonly retainedWalBytes: number | null;
|
|
9
|
-
readonly safeWalBytes: number | null;
|
|
10
|
-
};
|
|
11
|
-
export declare function slotHealthStatus(row: Pick<SlotHealthRow, 'restartLSN' | 'walStatus'> | undefined): SlotHealthStatus;
|
|
12
|
-
export declare function registerReplicationSlotHealthMetrics(lc: LogContext, db: PostgresDB, slot: string, isStopped: () => boolean): void;
|
|
13
|
-
export declare function queryReplicationSlotHealth(db: PostgresDB, slot: string): Promise<SlotHealthRow | undefined>;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=replication-slot-health.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replication-slot-health.d.ts","sourceRoot":"","sources":["../../../../../../../zero-cache/src/services/change-source/pg/replication-slot-health.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAErD,QAAA,MAAM,oBAAoB,YACxB,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,SAAS,EACT,SAAS,CACD,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC,CAAC;AAEF,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,YAAY,GAAG,WAAW,CAAC,GAAG,SAAS,GAC/D,gBAAgB,CAgBlB;AAED,wBAAgB,oCAAoC,CAClD,EAAE,EAAE,UAAU,EACd,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,OAAO,GACvB,IAAI,CAoCN;AAwBD,wBAAsB,0BAA0B,CAC9C,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAapC"}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import type { Readable } from 'node:stream';
|
|
2
|
-
import type { LogContext } from '@rocicorp/logger';
|
|
3
|
-
import postgres from 'postgres';
|
|
4
|
-
import { type PostgresDB } from '../../../types/pg.ts';
|
|
5
|
-
import { type ShardID } from '../../../types/shards.ts';
|
|
6
|
-
import { type ReplicaStage } from './schema/replica-stage-enum.ts';
|
|
7
|
-
import { type BackupOptions, type ReplicaState } from './schema/shard.ts';
|
|
8
|
-
export type ReplicationSlot = {
|
|
9
|
-
slot_name: string;
|
|
10
|
-
consistent_point: string;
|
|
11
|
-
snapshot_name: string;
|
|
12
|
-
output_plugin: string;
|
|
13
|
-
};
|
|
14
|
-
export type ReplicationSlotResult<T> = {
|
|
15
|
-
slot: ReplicationSlot;
|
|
16
|
-
capturedSnapshot: T;
|
|
17
|
-
initialSession: Readable;
|
|
18
|
-
replica: ReplicaState;
|
|
19
|
-
};
|
|
20
|
-
export type ReservedSlot = {
|
|
21
|
-
slot: string;
|
|
22
|
-
reservation: Readable;
|
|
23
|
-
replica: ReplicaState;
|
|
24
|
-
};
|
|
25
|
-
export type CreateSlotSpec = {
|
|
26
|
-
slotName: string;
|
|
27
|
-
failover?: boolean;
|
|
28
|
-
temporary?: boolean;
|
|
29
|
-
lockTimeout?: number | undefined;
|
|
30
|
-
diagnosticsDB?: PostgresDB | undefined;
|
|
31
|
-
};
|
|
32
|
-
export declare const CREATE_REPLICATION_SLOT_TIMEOUT_MS = 60000;
|
|
33
|
-
/** Thrown when the client-side timeout for creating a slot is reached. */
|
|
34
|
-
export declare class SlotCreationTimeoutError extends Error {
|
|
35
|
-
readonly name = "SlotCreationTimeoutError";
|
|
36
|
-
}
|
|
37
|
-
export declare function createReplicationSlot(lc: LogContext, session: postgres.Sql, { slotName, failover, temporary, lockTimeout, diagnosticsDB, }: CreateSlotSpec): Promise<ReplicationSlot>;
|
|
38
|
-
/**
|
|
39
|
-
* Best-effort logging of what a timed out CREATE_REPLICATION_SLOT was waiting
|
|
40
|
-
* on: the walsender's wait event and blocking pids, and the oldest
|
|
41
|
-
* transactions holding an xid. Slot creation waits for every such transaction
|
|
42
|
-
* on the instance (in all databases), each with its own lock_timeout, so a
|
|
43
|
-
* chain of overlapping transactions can exceed the client-side timeout
|
|
44
|
-
* without the lock_timeout ever firing.
|
|
45
|
-
*
|
|
46
|
-
* Query text is deliberately omitted since it can contain row values.
|
|
47
|
-
*
|
|
48
|
-
* Exported for testing.
|
|
49
|
-
*/
|
|
50
|
-
export declare function logSlotCreationBlockers(lc: LogContext, sql: PostgresDB, walsenderPID: number, slotName: string): Promise<void>;
|
|
51
|
-
export type CreateReplicaAndSlotOptions = {
|
|
52
|
-
lockTimeout?: number | undefined;
|
|
53
|
-
maxBlockedMs?: number | undefined;
|
|
54
|
-
retryDelayMs?: number | undefined;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Replica and slot creation involves several sessions for proper
|
|
58
|
-
* coordination with other replica management logic:
|
|
59
|
-
*
|
|
60
|
-
* * A dedicated session acquires a (session-level) advisory lock for
|
|
61
|
-
* replica slot management. This is the same lock that cleanup logic
|
|
62
|
-
* acquires before cleaning up replication slots. The lock is held
|
|
63
|
-
* outside of a transaction so that the session is not "idle in
|
|
64
|
-
* transaction" while slot creation waits on upstream transactions,
|
|
65
|
-
* which some upstreams terminate (e.g. idle_in_transaction_session_timeout).
|
|
66
|
-
* * With the lock held, a new replication slot is created in a
|
|
67
|
-
* replication session. The API of CREATE_REPLICATION_SLOT is such
|
|
68
|
-
* that it cannot be done in a transaction, and cannot be followed by
|
|
69
|
-
* any writes, or else its snapshot (which is needed for initial sync)
|
|
70
|
-
* would be invalidated.
|
|
71
|
-
* * Once the slot is created, the slot and replica information are recorded
|
|
72
|
-
* in the `replicas` table before releasing the lock.
|
|
73
|
-
*
|
|
74
|
-
* Slot creation waits for all transactions on the upstream instance that
|
|
75
|
-
* hold an xid, so it can be blocked by long-running transactions. A blocked
|
|
76
|
-
* attempt is abandoned (see {@link CREATE_REPLICATION_SLOT_TIMEOUT_MS}) and
|
|
77
|
-
* retried in-process, as it leaves no durable state: the `replicas` row is
|
|
78
|
-
* only inserted after the slot has been created. Retries continue until the
|
|
79
|
-
* slot is created or until `maxBlockedMs` has elapsed, after which the error
|
|
80
|
-
* is thrown.
|
|
81
|
-
*
|
|
82
|
-
* This locking ensures that:
|
|
83
|
-
* 1. multiple replication managers attempting to create a replication slot
|
|
84
|
-
* will not use the same name for the replication slot (which is selected
|
|
85
|
-
* from a pool of reused names).
|
|
86
|
-
* 2. Running replication managers (which use an earlier replica of a lower
|
|
87
|
-
* rank) will not delete the new slot during their cleanup logic, since
|
|
88
|
-
* the slot will belong to a replica of a higher rank.
|
|
89
|
-
*
|
|
90
|
-
* When the replication slot is created, `captureSnapshot` callback is first
|
|
91
|
-
* run while the snapshot at the consistent point is available. The callback
|
|
92
|
-
* must capture the snapshot in postgres (e.g. `SET TRANSACTION SNAPSHOT`)
|
|
93
|
-
* in order to use it. Once the callback completes, a placeholder replication
|
|
94
|
-
* session (i.e. that does not consume any messages) is started, in order to
|
|
95
|
-
* reserve the slot by mark it "active", effectively distinguishing the
|
|
96
|
-
* initializing session from a failed or abandoned session.
|
|
97
|
-
*
|
|
98
|
-
* Note that starting the replication session releases the initial snapshot,
|
|
99
|
-
* which is why the callback must capture it synchronously, before the
|
|
100
|
-
* replication session is started.
|
|
101
|
-
*
|
|
102
|
-
* The placeholder replication session is closed when the
|
|
103
|
-
* PostgresChangeSource takes over the slot to process the stream in earnest.
|
|
104
|
-
* It is also returned for cleanup in the case of failures (and for control
|
|
105
|
-
* in unit tests).
|
|
106
|
-
*
|
|
107
|
-
* For replica's created in the `Restore` stage, the `generation` is
|
|
108
|
-
* initialized to an empty string instead of the slot's consistent point,
|
|
109
|
-
* since the slot is not being used for initial sync. It is the
|
|
110
|
-
* responsibiliy of the caller to call {@link initRestoreReplica} when
|
|
111
|
-
* the source replica has been selected for restoring, which will carry
|
|
112
|
-
* over the `generation` and other relevant values from the source.
|
|
113
|
-
*/
|
|
114
|
-
export declare function createReplicaAndSlot<T>(lc: LogContext, sql: PostgresDB, sessionName: string, shard: ShardID, epoch: number, replicaID: string, failover: boolean, backupOptions: BackupOptions, captureSnapshot: (snapshot: string) => Promise<T>, stage: ReplicaStage, { lockTimeout, maxBlockedMs, retryDelayMs, }?: CreateReplicaAndSlotOptions): Promise<ReplicationSlotResult<T>>;
|
|
115
|
-
/**
|
|
116
|
-
* Claims the inactive slot of the given replica for use by this task, opening
|
|
117
|
-
* a replication session to mark it as active. The process should follow up by
|
|
118
|
-
* taking over the slot via the PostgresChangeSource.
|
|
119
|
-
*
|
|
120
|
-
* The replica is identified by its ID (and not just its slot) because rows of
|
|
121
|
-
* replicas whose slots were dropped outside of zero-cache's control may share
|
|
122
|
-
* the slot name.
|
|
123
|
-
*/
|
|
124
|
-
export declare function claimSlotForResumption(lc: LogContext, sql: PostgresDB, shard: ShardID, _sessionName: string, { id: replicaID, slot }: Pick<ReplicaState, 'id' | 'slot'>): Promise<ReservedSlot | null>;
|
|
125
|
-
export declare function dropInactiveSlotsAndReplicas(lc: LogContext, sql: PostgresDB, shard: ShardID, slots: string[]): Promise<void>;
|
|
126
|
-
export declare function slotPoolSuffix(n: number): string;
|
|
127
|
-
//# sourceMappingURL=replication-slots.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replication-slots.d.ts","sourceRoot":"","sources":["../../../../../../../zero-cache/src/services/change-source/pg/replication-slots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AAM1C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,QAA2C,MAAM,UAAU,CAAC;AAMnE,OAAO,EAAkB,KAAK,UAAU,EAAC,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAiB,KAAK,OAAO,EAAC,MAAM,0BAA0B,CAAC;AAWtE,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI;IACrC,IAAI,EAAE,eAAe,CAAC;IACtB,gBAAgB,EAAE,CAAC,CAAC;IACpB,cAAc,EAAE,QAAQ,CAAC;IACzB,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;I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,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,OAAO,EACjB,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,KAAK,EAAE,YAAY,EACnB,EACE,WAAW,EACX,YAAmD,EACnD,YAAmD,GACpD,GAAE,2BAAgC,GAClC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAiLnC;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,EAAE,EAAE,UAAU,EACd,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,OAAO,EACd,YAAY,EAAE,MAAM,EACpB,EAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAC,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC,GACvD,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CA0D9B;AAED,wBAAgB,4BAA4B,CAC1C,EAAE,EAAE,UAAU,EACd,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EAAE,iBA+BhB;AAmFD,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,UAUvC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { LogContext } from '@rocicorp/logger';
|
|
2
|
-
import type { PostgresDB } from '../../../../types/pg.ts';
|
|
3
|
-
import { type ShardConfig } from '../../../../types/shards.ts';
|
|
4
|
-
/**
|
|
5
|
-
* Ensures that a shard is set up for initial sync.
|
|
6
|
-
*/
|
|
7
|
-
export declare function ensureShardSchema(lc: LogContext, db: PostgresDB, shard: ShardConfig, installPartialIndexTriggers?: boolean): Promise<void>;
|
|
8
|
-
export declare const CURRENT_SCHEMA_VERSION: number;
|
|
9
|
-
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../../../zero-cache/src/services/change-source/pg/schema/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAQjD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAiB,KAAK,WAAW,EAAC,MAAM,6BAA6B,CAAC;AAa7E;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,EAAE,EAAE,UAAU,EACd,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,WAAW,EAClB,2BAA2B,UAAO,GACjC,OAAO,CAAC,IAAI,CAAC,CAiBf;AA8SD,eAAO,MAAM,sBAAsB,QASwB,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { BackfillProgressMark, BackfillRequest } from './current.ts';
|
|
2
|
-
/**
|
|
3
|
-
* The result of applying a backfill message to a column's tracked progress.
|
|
4
|
-
* If `accept` is true, `progress` is the column's new progress.
|
|
5
|
-
*/
|
|
6
|
-
export type AcceptResult = {
|
|
7
|
-
accept: true;
|
|
8
|
-
progress: BackfillProgressMark | undefined;
|
|
9
|
-
} | {
|
|
10
|
-
accept: false;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Applies the continuity policy of `backfill` (and `backfill-completed`)
|
|
14
|
-
* messages to a column's `own` tracked progress, where `undefined` means that
|
|
15
|
-
* the column has not received any backfill data (i.e. it needs a backfill
|
|
16
|
-
* from scratch).
|
|
17
|
-
*
|
|
18
|
-
* * Messages without `progressMarks` are from pre-v8 replication-managers
|
|
19
|
-
* and are accepted unconditionally (i.e. the legacy behavior), with no
|
|
20
|
-
* change to the tracked progress.
|
|
21
|
-
* * A message without a `previous` mark starts a backfill from scratch (or on
|
|
22
|
-
* a new timeline), and is always accepted.
|
|
23
|
-
* * Otherwise, the message is only accepted if it is on the same timeline as
|
|
24
|
-
* `own`, and continues from a position at or before `own` (i.e. it does not
|
|
25
|
-
* create a gap).
|
|
26
|
-
*
|
|
27
|
-
* `current` is unset for `backfill-completed` messages, which do not advance
|
|
28
|
-
* the progress.
|
|
29
|
-
*/
|
|
30
|
-
export declare function acceptBackfill(own: BackfillProgressMark | undefined, marks: {
|
|
31
|
-
previous?: BackfillProgressMark | undefined;
|
|
32
|
-
current?: BackfillProgressMark;
|
|
33
|
-
} | undefined): AcceptResult;
|
|
34
|
-
/**
|
|
35
|
-
* Returns whether a stream whose progress (for a column) is at `stream`
|
|
36
|
-
* will deliver all of the data needed by a subscriber whose progress (for the
|
|
37
|
-
* same column) is at `subscriber`. A `stream` progress of `undefined` indicates
|
|
38
|
-
* a backfill that will start from scratch, which covers all subscribers.
|
|
39
|
-
*/
|
|
40
|
-
export declare function covers(stream: BackfillProgressMark | undefined, subscriber: BackfillProgressMark | undefined): boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Returns the position from which a backfill for the `req` must start
|
|
43
|
-
* in order to satisfy the progress of all of its columns, i.e. the earliest
|
|
44
|
-
* progress mark, or `undefined` (i.e. from scratch) if any column has no
|
|
45
|
-
* progress or if the columns are on different timelines.
|
|
46
|
-
*/
|
|
47
|
-
export declare function resumePoint(req: BackfillRequest): BackfillProgressMark | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Returns a copy of the `req` with the progress of every column set to
|
|
50
|
-
* the request's {@link resumePoint}, i.e. the position from which the
|
|
51
|
-
* backfill of the request will actually start.
|
|
52
|
-
*/
|
|
53
|
-
export declare function withResumePoint(req: BackfillRequest): BackfillRequest;
|
|
54
|
-
/**
|
|
55
|
-
* Merges two BackfillRequests for the same table into one that satisfies
|
|
56
|
-
* both. Both requests are expected to reflect the same (current) upstream
|
|
57
|
-
* schema. For columns in both requests, the earlier progress mark is chosen,
|
|
58
|
-
* or no progress mark (i.e. from scratch) if they are on different timelines.
|
|
59
|
-
* If a column's backfill IDs differ (which is unexpected), the ID of `req1`
|
|
60
|
-
* is chosen, and the column is backfilled from scratch.
|
|
61
|
-
*/
|
|
62
|
-
export declare function getTableSuperset(req1: BackfillRequest, req2: BackfillRequest): BackfillRequest;
|
|
63
|
-
/**
|
|
64
|
-
* Merges the BackfillRequests of multiple parties (e.g. subscribers) into
|
|
65
|
-
* one request per table, using {@link getTableSuperset}.
|
|
66
|
-
*/
|
|
67
|
-
export declare function getSuperset(...requestSets: Iterable<BackfillRequest>[]): BackfillRequest[];
|
|
68
|
-
//# sourceMappingURL=backfill-progress.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backfill-progress.d.ts","sourceRoot":"","sources":["../../../../../../../zero-cache/src/services/change-source/protocol/backfill-progress.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EAEhB,MAAM,cAAc,CAAC;AAyBtB;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB;IAAC,MAAM,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,oBAAoB,GAAG,SAAS,CAAA;CAAC,GAC1D;IAAC,MAAM,EAAE,KAAK,CAAA;CAAC,CAAC;AAEpB;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,oBAAoB,GAAG,SAAS,EACrC,KAAK,EACD;IACE,QAAQ,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAC5C,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,GACD,SAAS,GACZ,YAAY,CAyBd;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CACpB,MAAM,EAAE,oBAAoB,GAAG,SAAS,EACxC,UAAU,EAAE,oBAAoB,GAAG,SAAS,GAC3C,OAAO,CAOT;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,eAAe,GACnB,oBAAoB,GAAG,SAAS,CAelC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,eAAe,CAWrE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,eAAe,EACrB,IAAI,EAAE,eAAe,GACpB,eAAe,CA4BjB;AAMD;;;GAGG;AACH,wBAAgB,WAAW,CACzB,GAAG,WAAW,EAAE,QAAQ,CAAC,eAAe,CAAC,EAAE,GAC1C,eAAe,EAAE,CAUnB"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import type { LogContext } from '@rocicorp/logger';
|
|
2
|
-
import type { Subscription } from '../../types/subscription.ts';
|
|
3
|
-
import type { ChangeStreamData } from '../change-source/protocol/current/downstream.ts';
|
|
4
|
-
import type { BackfillRequest } from '../change-source/protocol/current/upstream.ts';
|
|
5
|
-
import type { PreSerializedBatch } from './broadcast.ts';
|
|
6
|
-
import type { SubscriberContext } from './change-streamer.ts';
|
|
7
|
-
import type { Subscriber, SubscriberOptions } from './subscriber.ts';
|
|
8
|
-
export type SubscriberBackfillOptions = Pick<SubscriberOptions, 'backfills' | 'onAligned' | 'onBackfillIgnored'>;
|
|
9
|
-
/**
|
|
10
|
-
* Tracks the pending backfills (and their progress) of the change log, the
|
|
11
|
-
* subscribers, and the current change stream, in order to determine:
|
|
12
|
-
*
|
|
13
|
-
* * the BackfillRequests with which to start a change stream, i.e. the
|
|
14
|
-
* superset of the pending backfills of the change log and all aligned
|
|
15
|
-
* subscribers, starting from the earliest progress, and
|
|
16
|
-
* * whether (and why) the change stream must be restarted, i.e. when a
|
|
17
|
-
* newly aligned subscriber's pending backfills are not covered by the
|
|
18
|
-
* current stream.
|
|
19
|
-
*
|
|
20
|
-
* The change-streamer calls {@link startStream()} whenever it starts a change
|
|
21
|
-
* stream, {@link track()} for every change that it forwards, and restarts
|
|
22
|
-
* the stream at the next transaction boundary whenever a
|
|
23
|
-
* {@link restartReason} is set.
|
|
24
|
-
*/
|
|
25
|
-
export declare class BackfillStateTracker {
|
|
26
|
-
#private;
|
|
27
|
-
constructor(lc: LogContext);
|
|
28
|
-
/**
|
|
29
|
-
* The reason for which the change stream must be restarted, or `null` if
|
|
30
|
-
* it need not be. The restart should happen at the next transaction
|
|
31
|
-
* boundary, i.e. upon the next `commit`, or `status` message outside of a
|
|
32
|
-
* transaction.
|
|
33
|
-
*/
|
|
34
|
-
get restartReason(): string | null;
|
|
35
|
-
/**
|
|
36
|
-
* Computes the BackfillRequests with which to start a new change stream:
|
|
37
|
-
* the superset of the pending backfills of the change log and of all
|
|
38
|
-
* aligned subscribers, all of which are consistent with the stream's
|
|
39
|
-
* starting watermark since streams are (re)started at transaction
|
|
40
|
-
* boundaries.
|
|
41
|
-
*
|
|
42
|
-
* @param logBackfillRequests The BackfillRequests from the change log's
|
|
43
|
-
* cookie jar, consistent with the stream's starting watermark.
|
|
44
|
-
*/
|
|
45
|
-
startStream(logBackfillRequests: BackfillRequest[]): BackfillRequest[];
|
|
46
|
-
/**
|
|
47
|
-
* Tracks a change that is forwarded to subscribers. This must be called
|
|
48
|
-
* (synchronously) before the change is forwarded, so that the stream's
|
|
49
|
-
* state is never ahead of that of aligned subscribers.
|
|
50
|
-
*/
|
|
51
|
-
track(change: ChangeStreamData): void;
|
|
52
|
-
/**
|
|
53
|
-
* Requests a restart of the change stream (at the next transaction
|
|
54
|
-
* boundary), e.g. to start it with BackfillRequests that it was not
|
|
55
|
-
* started with.
|
|
56
|
-
*/
|
|
57
|
-
requestRestart(reason: string): void;
|
|
58
|
-
/** Logs and records a (planned) restart for the {@link restartReason}. */
|
|
59
|
-
recordRestart(): void;
|
|
60
|
-
/**
|
|
61
|
-
* Returns the backfill-related {@link SubscriberOptions} for a new
|
|
62
|
-
* subscriber, which must subsequently be passed to {@link register()}.
|
|
63
|
-
*/
|
|
64
|
-
subscriberOptions(lc: LogContext, ctx: SubscriberContext): SubscriberBackfillOptions;
|
|
65
|
-
/**
|
|
66
|
-
* Registers a subscriber (created with {@link subscriberOptions()}) until
|
|
67
|
-
* its `downstream` is closed. This is a no-op for subscribers that do not
|
|
68
|
-
* report their pending backfills.
|
|
69
|
-
*/
|
|
70
|
-
register(subscriber: Subscriber, downstream: Subscription<string | PreSerializedBatch>): void;
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=backfill-state-tracker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backfill-state-tracker.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/backfill-state-tracker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAGjD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAK9D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,iDAAiD,CAAC;AACtF,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,+CAA+C,CAAC;AAEnF,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAC,UAAU,EAAE,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAEnE,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,iBAAiB,EACjB,WAAW,GAAG,WAAW,GAAG,mBAAmB,CAChD,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,oBAAoB;;IA6C/B,YAAY,EAAE,EAAE,UAAU,EAEzB;IAED;;;;;OAKG;IACH,IAAI,aAAa,IAAI,MAAM,GAAG,IAAI,CAEjC;IAED;;;;;;;;;OASG;IACH,WAAW,CAAC,mBAAmB,EAAE,eAAe,EAAE,GAAG,eAAe,EAAE,CAyBrE;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,gBAAgB,QAG7B;IAED;;;;OAIG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,QAE5B;IAED,0EAA0E;IAC1E,aAAa,SAGZ;IAED;;;OAGG;IACH,iBAAiB,CACf,EAAE,EAAE,UAAU,EACd,GAAG,EAAE,iBAAiB,GACrB,yBAAyB,CAqB3B;IAED;;;;OAIG;IACH,QAAQ,CACN,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,YAAY,CAAC,MAAM,GAAG,kBAAkB,CAAC,QAMtD;CAsBF"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { BackfillRequest, ChangeStreamData } from '../change-source/protocol/current.ts';
|
|
2
|
-
import type { WatermarkedChange } from './change-streamer.ts';
|
|
3
|
-
/**
|
|
4
|
-
* Tracks the state of the pending backfills (and their progress) of a party
|
|
5
|
-
* in the replication stream (e.g. a subscriber, or the change-log itself), by
|
|
6
|
-
* applying the same policies that a subscriber applies to its replica:
|
|
7
|
-
* schema changes are folded with the {@link cookieOps} shared by the
|
|
8
|
-
* cookie jars, and `backfill` / `backfill-completed` messages are accepted
|
|
9
|
-
* or ignored with the continuity policy of {@link acceptBackfill}.
|
|
10
|
-
*
|
|
11
|
-
* Changes are applied transactionally: the changes of a transaction are
|
|
12
|
-
* discarded if it is rolled back, and {@link requests()} only reflects
|
|
13
|
-
* committed transactions.
|
|
14
|
-
*/
|
|
15
|
-
export declare class BackfillState {
|
|
16
|
-
#private;
|
|
17
|
-
constructor(requests?: readonly BackfillRequest[]);
|
|
18
|
-
/** The (committed) pending backfills. */
|
|
19
|
-
requests(): BackfillRequest[];
|
|
20
|
-
/**
|
|
21
|
-
* Returns the `requests` with the (committed) progress of this state
|
|
22
|
-
* applied to the columns that are pending in both, i.e. same table, column,
|
|
23
|
-
* and backfill ID. Other columns have no progress (i.e. from scratch).
|
|
24
|
-
*/
|
|
25
|
-
withProgress(requests: readonly BackfillRequest[]): BackfillRequest[];
|
|
26
|
-
/** Whether there are no (committed) pending backfills. */
|
|
27
|
-
get empty(): boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Returns the columns (as `schema.table.column` strings) with (committed)
|
|
30
|
-
* pending backfills that are not covered by the (committed) progress of the
|
|
31
|
-
* `stream`, i.e. columns for which the `stream` will not deliver all of the
|
|
32
|
-
* necessary data.
|
|
33
|
-
*/
|
|
34
|
-
uncovered(stream: BackfillState): string[];
|
|
35
|
-
/**
|
|
36
|
-
* Applies a serialized change, parsing it only if it is relevant.
|
|
37
|
-
*
|
|
38
|
-
* @returns The columns (as `schema.table.column` strings) of a backfill
|
|
39
|
-
* message that were ignored due to the continuity policy.
|
|
40
|
-
*/
|
|
41
|
-
applySerialized([, tag, json]: WatermarkedChange): string[];
|
|
42
|
-
/**
|
|
43
|
-
* Applies a change.
|
|
44
|
-
*
|
|
45
|
-
* @returns The columns (as `schema.table.column` strings) of a backfill
|
|
46
|
-
* message that were ignored due to the continuity policy.
|
|
47
|
-
*/
|
|
48
|
-
apply(change: ChangeStreamData): string[];
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=backfill-state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backfill-state.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/backfill-state.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAIjB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,KAAK,EAAY,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AA8CvE;;;;;;;;;;;GAWG;AACH,qBAAa,aAAa;;IAIxB,YAAY,QAAQ,GAAE,SAAS,eAAe,EAAO,EASpD;IAMD,yCAAyC;IACzC,QAAQ,IAAI,eAAe,EAAE,CAE5B;IAED;;;;OAIG;IACH,YAAY,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,GAAG,eAAe,EAAE,CAmBpE;IAED,0DAA0D;IAC1D,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,EAAE,CAazC;IAED;;;;;OAKG;IACH,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAgB1D;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,EAAE,CA4DxC;CA6HF"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { LogContext } from '@rocicorp/logger';
|
|
2
|
-
import type { NormalizedZeroConfig } from '../../config/normalize.ts';
|
|
3
|
-
import { BackupMonitor } from './backup-monitor.ts';
|
|
4
|
-
import { type BackupStateVerifier } from './litestream3-prometheus-poller.ts';
|
|
5
|
-
export type BackupCleanupMonitorFactoryOptions = {
|
|
6
|
-
lc: LogContext;
|
|
7
|
-
config: NormalizedZeroConfig;
|
|
8
|
-
replicaFile: string;
|
|
9
|
-
verifyBackupState?: BackupStateVerifier | undefined;
|
|
10
|
-
};
|
|
11
|
-
export declare function createBackupCleanupMonitor({ lc, config, replicaFile, verifyBackupState, }: BackupCleanupMonitorFactoryOptions): BackupMonitor;
|
|
12
|
-
//# sourceMappingURL=backup-cleanup-monitor-factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backup-cleanup-monitor-factory.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAKpE,OAAO,EAAC,aAAa,EAAoB,MAAM,qBAAqB,CAAC;AAErE,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,oCAAoC,CAAC;AAG5C,MAAM,MAAM,kCAAkC,GAAG;IAC/C,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,EAAE,oBAAoB,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;CACrD,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,EACzC,EAAE,EACF,MAAM,EACN,WAAW,EACX,iBAAiB,GAClB,EAAE,kCAAkC,GAAG,aAAa,CAyBpD"}
|