@rocicorp/zero 1.12.0-canary.5 → 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.
Files changed (414) hide show
  1. package/out/replicache/src/btree/node.js +1 -1
  2. package/out/replicache/src/deleted-clients.d.ts.map +1 -1
  3. package/out/replicache/src/deleted-clients.js +2 -1
  4. package/out/replicache/src/deleted-clients.js.map +1 -1
  5. package/out/replicache/src/kv/sqlite-store.d.ts.map +1 -1
  6. package/out/replicache/src/kv/sqlite-store.js +7 -3
  7. package/out/replicache/src/kv/sqlite-store.js.map +1 -1
  8. package/out/replicache/src/replicache-impl.d.ts.map +1 -1
  9. package/out/replicache/src/replicache-impl.js +17 -14
  10. package/out/replicache/src/replicache-impl.js.map +1 -1
  11. package/out/z2s/src/compiler.js +3 -3
  12. package/out/z2s/src/compiler.js.map +1 -1
  13. package/out/zero/package.js +11 -11
  14. package/out/zero/package.js.map +1 -1
  15. package/out/zero-cache/src/auth/write-authorizer.js +9 -2
  16. package/out/zero-cache/src/auth/write-authorizer.js.map +1 -1
  17. package/out/zero-cache/src/config/zero-config.js +2 -2
  18. package/out/zero-cache/src/config/zero-config.js.map +1 -1
  19. package/out/zero-cache/src/server/change-streamer.js +33 -9
  20. package/out/zero-cache/src/server/change-streamer.js.map +1 -1
  21. package/out/zero-cache/src/services/change-source/common/replica-restore.js.map +1 -1
  22. package/out/zero-cache/src/services/change-source/pg/change-source-init.js +49 -24
  23. package/out/zero-cache/src/services/change-source/pg/change-source-init.js.map +1 -1
  24. package/out/zero-cache/src/services/change-source/pg/change-source.js +64 -7
  25. package/out/zero-cache/src/services/change-source/pg/change-source.js.map +1 -1
  26. package/out/zero-cache/src/services/change-source/pg/fork-request.js +54 -0
  27. package/out/zero-cache/src/services/change-source/pg/fork-request.js.map +1 -0
  28. package/out/zero-cache/src/services/change-source/pg/replication-slots.js +6 -0
  29. package/out/zero-cache/src/services/change-source/pg/replication-slots.js.map +1 -1
  30. package/out/zero-cache/src/services/change-source/protocol/current/downstream.d.ts +1 -0
  31. package/out/zero-cache/src/services/change-source/protocol/current/downstream.d.ts.map +1 -1
  32. package/out/zero-cache/src/services/change-source/protocol/current/status.d.ts +3 -0
  33. package/out/zero-cache/src/services/change-source/protocol/current/status.d.ts.map +1 -1
  34. package/out/zero-cache/src/services/change-source/protocol/current/status.js +2 -1
  35. package/out/zero-cache/src/services/change-source/protocol/current/status.js.map +1 -1
  36. package/out/zero-cache/src/services/change-source/protocol/current/upstream.d.ts +1 -0
  37. package/out/zero-cache/src/services/change-source/protocol/current/upstream.d.ts.map +1 -1
  38. package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.js +6 -6
  39. package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.js.map +1 -1
  40. package/out/zero-cache/src/services/change-streamer/backup-monitor.js +55 -20
  41. package/out/zero-cache/src/services/change-streamer/backup-monitor.js.map +1 -1
  42. package/out/zero-cache/src/services/change-streamer/change-streamer-service.js +27 -8
  43. package/out/zero-cache/src/services/change-streamer/change-streamer-service.js.map +1 -1
  44. package/out/zero-cache/src/services/change-streamer/change-streamer.js.map +1 -1
  45. package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.js +80 -11
  46. package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.js.map +1 -1
  47. package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.js.map +1 -1
  48. package/out/zero-cache/src/services/change-streamer/replica-poller.js.map +1 -1
  49. package/out/zero-cache/src/services/change-streamer/server-start-metrics.js +42 -0
  50. package/out/zero-cache/src/services/change-streamer/server-start-metrics.js.map +1 -0
  51. package/out/zero-cache/src/services/change-streamer/subscriber.js +5 -4
  52. package/out/zero-cache/src/services/change-streamer/subscriber.js.map +1 -1
  53. package/out/zero-cache/src/services/mutagen/mutagen.js +1 -2
  54. package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
  55. package/out/zero-cache/src/services/view-syncer/view-syncer.js +19 -2
  56. package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
  57. package/out/zero-client/src/client/version.js +1 -1
  58. package/out/zero-protocol/src/ast.d.ts.map +1 -1
  59. package/out/zero-protocol/src/ast.js +2 -1
  60. package/out/zero-protocol/src/ast.js.map +1 -1
  61. package/out/zero-protocol/src/down.d.ts +27 -27
  62. package/out/zero-protocol/src/inspect-down.d.ts +81 -81
  63. package/out/zero-protocol/src/up.d.ts +60 -60
  64. package/package.json +11 -11
  65. package/out/shared/src/cache.d.ts +0 -22
  66. package/out/shared/src/cache.d.ts.map +0 -1
  67. package/out/shared/src/custom-key-map.d.ts +0 -26
  68. package/out/shared/src/custom-key-map.d.ts.map +0 -1
  69. package/out/shared/src/custom-key-set.d.ts +0 -25
  70. package/out/shared/src/custom-key-set.d.ts.map +0 -1
  71. package/out/shared/src/logging-test-utils.d.ts +0 -12
  72. package/out/shared/src/logging-test-utils.d.ts.map +0 -1
  73. package/out/shared/src/queue.d.ts +0 -53
  74. package/out/shared/src/queue.d.ts.map +0 -1
  75. package/out/shared/src/ring-buffer.d.ts +0 -42
  76. package/out/shared/src/ring-buffer.d.ts.map +0 -1
  77. package/out/shared/src/sorted-entries.d.ts +0 -2
  78. package/out/shared/src/sorted-entries.d.ts.map +0 -1
  79. package/out/zero/src/server/change-streamer.d.ts +0 -2
  80. package/out/zero/src/server/change-streamer.d.ts.map +0 -1
  81. package/out/zero/src/server/main.d.ts +0 -2
  82. package/out/zero/src/server/main.d.ts.map +0 -1
  83. package/out/zero/src/server/reaper.d.ts +0 -2
  84. package/out/zero/src/server/reaper.d.ts.map +0 -1
  85. package/out/zero/src/server/replicator.d.ts +0 -2
  86. package/out/zero/src/server/replicator.d.ts.map +0 -1
  87. package/out/zero/src/server/syncer.d.ts +0 -2
  88. package/out/zero/src/server/syncer.d.ts.map +0 -1
  89. package/out/zero-cache/src/auth/jwt.d.ts +0 -12
  90. package/out/zero-cache/src/auth/jwt.d.ts.map +0 -1
  91. package/out/zero-cache/src/auth/load-permissions.d.ts +0 -17
  92. package/out/zero-cache/src/auth/load-permissions.d.ts.map +0 -1
  93. package/out/zero-cache/src/auth/write-authorizer.d.ts +0 -28
  94. package/out/zero-cache/src/auth/write-authorizer.d.ts.map +0 -1
  95. package/out/zero-cache/src/config/server-context.d.ts +0 -16
  96. package/out/zero-cache/src/config/server-context.d.ts.map +0 -1
  97. package/out/zero-cache/src/custom/fetch.d.ts +0 -38
  98. package/out/zero-cache/src/custom/fetch.d.ts.map +0 -1
  99. package/out/zero-cache/src/custom/metrics.d.ts +0 -31
  100. package/out/zero-cache/src/custom/metrics.d.ts.map +0 -1
  101. package/out/zero-cache/src/custom-queries/transform-query.d.ts +0 -68
  102. package/out/zero-cache/src/custom-queries/transform-query.d.ts.map +0 -1
  103. package/out/zero-cache/src/db/create.d.ts +0 -12
  104. package/out/zero-cache/src/db/create.d.ts.map +0 -1
  105. package/out/zero-cache/src/db/delete-lite-db.d.ts +0 -2
  106. package/out/zero-cache/src/db/delete-lite-db.d.ts.map +0 -1
  107. package/out/zero-cache/src/db/index-predicate.d.ts +0 -4
  108. package/out/zero-cache/src/db/index-predicate.d.ts.map +0 -1
  109. package/out/zero-cache/src/db/migration-lite.d.ts +0 -78
  110. package/out/zero-cache/src/db/migration-lite.d.ts.map +0 -1
  111. package/out/zero-cache/src/db/migration.d.ts +0 -80
  112. package/out/zero-cache/src/db/migration.d.ts.map +0 -1
  113. package/out/zero-cache/src/db/pg-copy-binary.d.ts +0 -101
  114. package/out/zero-cache/src/db/pg-copy-binary.d.ts.map +0 -1
  115. package/out/zero-cache/src/db/pg-copy.d.ts +0 -30
  116. package/out/zero-cache/src/db/pg-copy.d.ts.map +0 -1
  117. package/out/zero-cache/src/db/pg-type-parser.d.ts +0 -15
  118. package/out/zero-cache/src/db/pg-type-parser.d.ts.map +0 -1
  119. package/out/zero-cache/src/db/transaction-pool.d.ts +0 -205
  120. package/out/zero-cache/src/db/transaction-pool.d.ts.map +0 -1
  121. package/out/zero-cache/src/db/warmup.d.ts +0 -4
  122. package/out/zero-cache/src/db/warmup.d.ts.map +0 -1
  123. package/out/zero-cache/src/observability/events.d.ts +0 -15
  124. package/out/zero-cache/src/observability/events.d.ts.map +0 -1
  125. package/out/zero-cache/src/observability/log-throttle.d.ts +0 -44
  126. package/out/zero-cache/src/observability/log-throttle.d.ts.map +0 -1
  127. package/out/zero-cache/src/server/anonymous-otel-start.d.ts +0 -21
  128. package/out/zero-cache/src/server/anonymous-otel-start.d.ts.map +0 -1
  129. package/out/zero-cache/src/server/change-streamer.d.ts +0 -3
  130. package/out/zero-cache/src/server/change-streamer.d.ts.map +0 -1
  131. package/out/zero-cache/src/server/inspector-delegate.d.ts +0 -71
  132. package/out/zero-cache/src/server/inspector-delegate.d.ts.map +0 -1
  133. package/out/zero-cache/src/server/main.d.ts +0 -3
  134. package/out/zero-cache/src/server/main.d.ts.map +0 -1
  135. package/out/zero-cache/src/server/otel-diag-logger.d.ts +0 -16
  136. package/out/zero-cache/src/server/otel-diag-logger.d.ts.map +0 -1
  137. package/out/zero-cache/src/server/otel-start.d.ts +0 -3
  138. package/out/zero-cache/src/server/otel-start.d.ts.map +0 -1
  139. package/out/zero-cache/src/server/priority-op.d.ts +0 -8
  140. package/out/zero-cache/src/server/priority-op.d.ts.map +0 -1
  141. package/out/zero-cache/src/server/reaper.d.ts +0 -3
  142. package/out/zero-cache/src/server/reaper.d.ts.map +0 -1
  143. package/out/zero-cache/src/server/replicator.d.ts +0 -10
  144. package/out/zero-cache/src/server/replicator.d.ts.map +0 -1
  145. package/out/zero-cache/src/server/slot-keeper.d.ts +0 -26
  146. package/out/zero-cache/src/server/slot-keeper.d.ts.map +0 -1
  147. package/out/zero-cache/src/server/syncer-assigner.d.ts +0 -14
  148. package/out/zero-cache/src/server/syncer-assigner.d.ts.map +0 -1
  149. package/out/zero-cache/src/server/syncer.d.ts +0 -3
  150. package/out/zero-cache/src/server/syncer.d.ts.map +0 -1
  151. package/out/zero-cache/src/server/worker-dispatcher.d.ts +0 -17
  152. package/out/zero-cache/src/server/worker-dispatcher.d.ts.map +0 -1
  153. package/out/zero-cache/src/services/analyze.d.ts +0 -9
  154. package/out/zero-cache/src/services/analyze.d.ts.map +0 -1
  155. package/out/zero-cache/src/services/change-source/change-source.d.ts +0 -32
  156. package/out/zero-cache/src/services/change-source/change-source.d.ts.map +0 -1
  157. package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts +0 -57
  158. package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts.map +0 -1
  159. package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts +0 -55
  160. package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts.map +0 -1
  161. package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts +0 -24
  162. package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts.map +0 -1
  163. package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts +0 -115
  164. package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts.map +0 -1
  165. package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts +0 -14
  166. package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts.map +0 -1
  167. package/out/zero-cache/src/services/change-source/custom/change-source.d.ts +0 -25
  168. package/out/zero-cache/src/services/change-source/custom/change-source.d.ts.map +0 -1
  169. package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts +0 -14
  170. package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts.map +0 -1
  171. package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts +0 -36
  172. package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts.map +0 -1
  173. package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts +0 -65
  174. package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts.map +0 -1
  175. package/out/zero-cache/src/services/change-source/pg/change-source.d.ts +0 -115
  176. package/out/zero-cache/src/services/change-source/pg/change-source.d.ts.map +0 -1
  177. package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts +0 -155
  178. package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts.map +0 -1
  179. package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts +0 -17
  180. package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts.map +0 -1
  181. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts +0 -28
  182. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts.map +0 -1
  183. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts +0 -76
  184. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts.map +0 -1
  185. package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts +0 -169
  186. package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts.map +0 -1
  187. package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts +0 -16
  188. package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts.map +0 -1
  189. package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts +0 -15
  190. package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts.map +0 -1
  191. package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts +0 -127
  192. package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts.map +0 -1
  193. package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts +0 -9
  194. package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts.map +0 -1
  195. package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts +0 -68
  196. package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts.map +0 -1
  197. package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts +0 -72
  198. package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts.map +0 -1
  199. package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts +0 -50
  200. package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts.map +0 -1
  201. package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts +0 -14
  202. package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts.map +0 -1
  203. package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts +0 -18
  204. package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts.map +0 -1
  205. package/out/zero-cache/src/services/change-streamer/broadcast.d.ts +0 -98
  206. package/out/zero-cache/src/services/change-streamer/broadcast.d.ts.map +0 -1
  207. package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts +0 -34
  208. package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts.map +0 -1
  209. package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts +0 -34
  210. package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts.map +0 -1
  211. package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts +0 -158
  212. package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts.map +0 -1
  213. package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts +0 -19
  214. package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts.map +0 -1
  215. package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts +0 -78
  216. package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts.map +0 -1
  217. package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts +0 -143
  218. package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts.map +0 -1
  219. package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts +0 -586
  220. package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts.map +0 -1
  221. package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts +0 -24
  222. package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts.map +0 -1
  223. package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts +0 -15
  224. package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts.map +0 -1
  225. package/out/zero-cache/src/services/change-streamer/forwarder.d.ts +0 -49
  226. package/out/zero-cache/src/services/change-streamer/forwarder.d.ts.map +0 -1
  227. package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts +0 -53
  228. package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts.map +0 -1
  229. package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts +0 -88
  230. package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts.map +0 -1
  231. package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts +0 -15
  232. package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts.map +0 -1
  233. package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts +0 -243
  234. package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts.map +0 -1
  235. package/out/zero-cache/src/services/change-streamer/schema/init.d.ts +0 -6
  236. package/out/zero-cache/src/services/change-streamer/schema/init.d.ts.map +0 -1
  237. package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts +0 -152
  238. package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts.map +0 -1
  239. package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts +0 -11
  240. package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts.map +0 -1
  241. package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts +0 -92
  242. package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts.map +0 -1
  243. package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts +0 -36
  244. package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts.map +0 -1
  245. package/out/zero-cache/src/services/change-streamer/snapshot.d.ts +0 -22
  246. package/out/zero-cache/src/services/change-streamer/snapshot.d.ts.map +0 -1
  247. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts +0 -99
  248. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts.map +0 -1
  249. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts +0 -83
  250. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts.map +0 -1
  251. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts +0 -121
  252. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts.map +0 -1
  253. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts +0 -73
  254. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts.map +0 -1
  255. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts +0 -62
  256. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts.map +0 -1
  257. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts +0 -114
  258. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts.map +0 -1
  259. package/out/zero-cache/src/services/change-streamer/storer.d.ts +0 -276
  260. package/out/zero-cache/src/services/change-streamer/storer.d.ts.map +0 -1
  261. package/out/zero-cache/src/services/change-streamer/subscribe.d.ts +0 -485
  262. package/out/zero-cache/src/services/change-streamer/subscribe.d.ts.map +0 -1
  263. package/out/zero-cache/src/services/change-streamer/subscriber.d.ts +0 -194
  264. package/out/zero-cache/src/services/change-streamer/subscriber.d.ts.map +0 -1
  265. package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts +0 -52
  266. package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts.map +0 -1
  267. package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts +0 -57
  268. package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts.map +0 -1
  269. package/out/zero-cache/src/services/litestream/commands.d.ts +0 -77
  270. package/out/zero-cache/src/services/litestream/commands.d.ts.map +0 -1
  271. package/out/zero-cache/src/services/litestream/litestream-controller.d.ts +0 -78
  272. package/out/zero-cache/src/services/litestream/litestream-controller.d.ts.map +0 -1
  273. package/out/zero-cache/src/services/litestream/metrics.d.ts +0 -31
  274. package/out/zero-cache/src/services/litestream/metrics.d.ts.map +0 -1
  275. package/out/zero-cache/src/services/litestream/restore-progress.d.ts +0 -24
  276. package/out/zero-cache/src/services/litestream/restore-progress.d.ts.map +0 -1
  277. package/out/zero-cache/src/services/mutagen/mutagen.d.ts +0 -40
  278. package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +0 -1
  279. package/out/zero-cache/src/services/mutagen/pusher.d.ts +0 -63
  280. package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +0 -1
  281. package/out/zero-cache/src/services/replicator/change-log-db.d.ts +0 -368
  282. package/out/zero-cache/src/services/replicator/change-log-db.d.ts.map +0 -1
  283. package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts +0 -56
  284. package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts.map +0 -1
  285. package/out/zero-cache/src/services/replicator/change-processor.d.ts +0 -37
  286. package/out/zero-cache/src/services/replicator/change-processor.d.ts.map +0 -1
  287. package/out/zero-cache/src/services/replicator/drain-handler.d.ts +0 -82
  288. package/out/zero-cache/src/services/replicator/drain-handler.d.ts.map +0 -1
  289. package/out/zero-cache/src/services/replicator/incremental-sync.d.ts +0 -25
  290. package/out/zero-cache/src/services/replicator/incremental-sync.d.ts.map +0 -1
  291. package/out/zero-cache/src/services/replicator/notifier.d.ts +0 -9
  292. package/out/zero-cache/src/services/replicator/notifier.d.ts.map +0 -1
  293. package/out/zero-cache/src/services/replicator/replication-status.d.ts +0 -71
  294. package/out/zero-cache/src/services/replicator/replication-status.d.ts.map +0 -1
  295. package/out/zero-cache/src/services/replicator/replicator.d.ts +0 -86
  296. package/out/zero-cache/src/services/replicator/replicator.d.ts.map +0 -1
  297. package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts +0 -55
  298. package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts.map +0 -1
  299. package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts +0 -132
  300. package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts.map +0 -1
  301. package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts +0 -120
  302. package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts.map +0 -1
  303. package/out/zero-cache/src/services/replicator/write-worker-client.d.ts +0 -111
  304. package/out/zero-cache/src/services/replicator/write-worker-client.d.ts.map +0 -1
  305. package/out/zero-cache/src/services/run-ast.d.ts +0 -39
  306. package/out/zero-cache/src/services/run-ast.d.ts.map +0 -1
  307. package/out/zero-cache/src/services/runner.d.ts +0 -19
  308. package/out/zero-cache/src/services/runner.d.ts.map +0 -1
  309. package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts +0 -17
  310. package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts.map +0 -1
  311. package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts +0 -26
  312. package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts.map +0 -1
  313. package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts +0 -79
  314. package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts.map +0 -1
  315. package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +0 -97
  316. package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +0 -1
  317. package/out/zero-cache/src/services/view-syncer/client-schema.d.ts +0 -18
  318. package/out/zero-cache/src/services/view-syncer/client-schema.d.ts.map +0 -1
  319. package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts +0 -184
  320. package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts.map +0 -1
  321. package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts +0 -22
  322. package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts.map +0 -1
  323. package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +0 -128
  324. package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +0 -1
  325. package/out/zero-cache/src/services/view-syncer/cvr.d.ts +0 -294
  326. package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +0 -1
  327. package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts +0 -81
  328. package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts.map +0 -1
  329. package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts +0 -45
  330. package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts.map +0 -1
  331. package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts +0 -53
  332. package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts.map +0 -1
  333. package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts +0 -33
  334. package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts.map +0 -1
  335. package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts +0 -51
  336. package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts.map +0 -1
  337. package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts +0 -34
  338. package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts.map +0 -1
  339. package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts +0 -296
  340. package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +0 -1
  341. package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts +0 -7
  342. package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts.map +0 -1
  343. package/out/zero-cache/src/services/view-syncer/push-cost.d.ts +0 -132
  344. package/out/zero-cache/src/services/view-syncer/push-cost.d.ts.map +0 -1
  345. package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts +0 -55
  346. package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts.map +0 -1
  347. package/out/zero-cache/src/services/view-syncer/query-covering.d.ts +0 -28
  348. package/out/zero-cache/src/services/view-syncer/query-covering.d.ts.map +0 -1
  349. package/out/zero-cache/src/services/view-syncer/query-shape.d.ts +0 -25
  350. package/out/zero-cache/src/services/view-syncer/query-shape.d.ts.map +0 -1
  351. package/out/zero-cache/src/services/view-syncer/query-stats.d.ts +0 -89
  352. package/out/zero-cache/src/services/view-syncer/query-stats.d.ts.map +0 -1
  353. package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts +0 -90
  354. package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts.map +0 -1
  355. package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts +0 -17
  356. package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts.map +0 -1
  357. package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts +0 -86
  358. package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts.map +0 -1
  359. package/out/zero-cache/src/services/view-syncer/schema/init.d.ts +0 -5
  360. package/out/zero-cache/src/services/view-syncer/schema/init.d.ts.map +0 -1
  361. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +0 -563
  362. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts.map +0 -1
  363. package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts +0 -95
  364. package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts.map +0 -1
  365. package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts +0 -420
  366. package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts.map +0 -1
  367. package/out/zero-cache/src/services/view-syncer/tracer.d.ts +0 -2
  368. package/out/zero-cache/src/services/view-syncer/tracer.d.ts.map +0 -1
  369. package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts +0 -10
  370. package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts.map +0 -1
  371. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +0 -133
  372. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +0 -1
  373. package/out/zero-cache/src/types/downstream.d.ts +0 -11
  374. package/out/zero-cache/src/types/downstream.d.ts.map +0 -1
  375. package/out/zero-cache/src/types/error-with-level.d.ts +0 -9
  376. package/out/zero-cache/src/types/error-with-level.d.ts.map +0 -1
  377. package/out/zero-cache/src/types/pg-patch.d.ts +0 -21
  378. package/out/zero-cache/src/types/pg-patch.d.ts.map +0 -1
  379. package/out/zero-cache/src/types/pg-versions.d.ts +0 -3
  380. package/out/zero-cache/src/types/pg-versions.d.ts.map +0 -1
  381. package/out/zero-cache/src/types/poke-chunk.d.ts +0 -18
  382. package/out/zero-cache/src/types/poke-chunk.d.ts.map +0 -1
  383. package/out/zero-cache/src/types/streams.d.ts +0 -115
  384. package/out/zero-cache/src/types/streams.d.ts.map +0 -1
  385. package/out/zero-cache/src/types/subscription.d.ts +0 -197
  386. package/out/zero-cache/src/types/subscription.d.ts.map +0 -1
  387. package/out/zero-cache/src/workers/connect-params.d.ts +0 -28
  388. package/out/zero-cache/src/workers/connect-params.d.ts.map +0 -1
  389. package/out/zero-cache/src/workers/connection.d.ts +0 -77
  390. package/out/zero-cache/src/workers/connection.d.ts.map +0 -1
  391. package/out/zero-cache/src/workers/replicator.d.ts +0 -57
  392. package/out/zero-cache/src/workers/replicator.d.ts.map +0 -1
  393. package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts +0 -14
  394. package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts.map +0 -1
  395. package/out/zero-cache/src/workers/syncer.d.ts +0 -67
  396. package/out/zero-cache/src/workers/syncer.d.ts.map +0 -1
  397. package/out/zero-events/src/index.d.ts +0 -27
  398. package/out/zero-events/src/index.d.ts.map +0 -1
  399. package/out/zero-events/src/json.d.ts +0 -20
  400. package/out/zero-events/src/json.d.ts.map +0 -1
  401. package/out/zero-events/src/status.d.ts +0 -144
  402. package/out/zero-events/src/status.d.ts.map +0 -1
  403. package/out/zqlite/src/database-storage.d.ts +0 -43
  404. package/out/zqlite/src/database-storage.d.ts.map +0 -1
  405. package/out/zqlite/src/explain-queries.d.ts +0 -4
  406. package/out/zqlite/src/explain-queries.d.ts.map +0 -1
  407. package/out/zqlite/src/internal/sql-inline.d.ts +0 -13
  408. package/out/zqlite/src/internal/sql-inline.d.ts.map +0 -1
  409. package/out/zqlite/src/resolve-scalar-subqueries.d.ts +0 -72
  410. package/out/zqlite/src/resolve-scalar-subqueries.d.ts.map +0 -1
  411. package/out/zqlite/src/sqlite-cost-model.d.ts +0 -17
  412. package/out/zqlite/src/sqlite-cost-model.d.ts.map +0 -1
  413. package/out/zqlite/src/sqlite-stat-fanout.d.ts +0 -121
  414. package/out/zqlite/src/sqlite-stat-fanout.d.ts.map +0 -1
@@ -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;AAUtE,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;IACb,WAAW,EAAE,QAAQ,CAAC;IACtB,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAInB,SAAS,CAAC,EAAE,OAAO,CAAC;IAGpB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAIjC,aAAa,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACxC,CAAC;AAUF,eAAO,MAAM,kCAAkC,QAAS,CAAC;AAOzD,0EAA0E;AAC1E,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,QAAQ,CAAC,IAAI,8BAA8B;CAC5C;AAKD,wBAAsB,qBAAqB,CACzC,EAAE,EAAE,UAAU,EACd,OAAO,EAAE,QAAQ,CAAC,GAAG,EACrB,EACE,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,WAAoC,EACpC,aAAa,GACd,EAAE,cAAc,GAChB,OAAO,CAAC,eAAe,CAAC,CAwD1B;AAKD;;;;;;;;;;;GAWG;AACH,wBAAsB,uBAAuB,CAC3C,EAAE,EAAE,UAAU,EACd,GAAG,EAAE,UAAU,EACf,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,iBAmCjB;AA0BD,MAAM,MAAM,2BAA2B,GAAG;IAExC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC,CAAC;AAsBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,wBAAsB,oBAAoB,CAAC,CAAC,EAC1C,EAAE,EAAE,UAAU,EACd,GAAG,EAAE,UAAU,EACf,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,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,CAsKnC;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,14 +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 { ChangeStreamerService } from './change-streamer.ts';
5
- import { type BackupStateVerifier } from './litestream3-prometheus-poller.ts';
6
- export type BackupCleanupMonitorFactoryOptions = {
7
- lc: LogContext;
8
- config: NormalizedZeroConfig;
9
- replicaFile: string;
10
- changeStreamer: ChangeStreamerService;
11
- verifyBackupState?: BackupStateVerifier | undefined;
12
- };
13
- export declare function createBackupCleanupMonitor({ lc, config, replicaFile, changeStreamer, verifyBackupState, }: BackupCleanupMonitorFactoryOptions): BackupMonitor;
14
- //# 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;AAMpE,OAAO,EAAyB,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAC1E,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAEhE,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,cAAc,EAAE,qBAAqB,CAAC;IACtC,iBAAiB,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;CACrD,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,EACzC,EAAE,EACF,MAAM,EACN,WAAW,EACX,cAAc,EACd,iBAAiB,GAClB,EAAE,kCAAkC,GAAG,aAAa,CAyBpD"}
@@ -1,18 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { Source } from '../../types/streams.ts';
3
- import type { SingletonService } from '../service.ts';
4
- import type { ChangeStreamerService } from './change-streamer.ts';
5
- export type BackedUpWatermark = {
6
- watermark: string;
7
- writeTimeMs?: number | undefined;
8
- backupTimeMs: number;
9
- };
10
- export declare class BackupMonitor implements SingletonService {
11
- #private;
12
- readonly id = "backup-monitor";
13
- constructor(lc: LogContext, watermarks: Source<BackedUpWatermark>, changeStreamer: ChangeStreamerService, replicaFile: string);
14
- firstBackupReceived(): Promise<void>;
15
- run(): Promise<void>;
16
- stop(): Promise<void>;
17
- }
18
- //# sourceMappingURL=backup-monitor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"backup-monitor.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/backup-monitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAKjD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAEhE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,qBAAa,aAAc,YAAW,gBAAgB;;IACpD,QAAQ,CAAC,EAAE,oBAAoB;IAiB/B,YACE,EAAE,EAAE,UAAU,EACd,UAAU,EAAE,MAAM,CAAC,iBAAiB,CAAC,EACrC,cAAc,EAAE,qBAAqB,EACrC,WAAW,EAAE,MAAM,EAMpB;IAED,mBAAmB,kBAElB;IAEK,GAAG,kBA8BR;IAqDD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAGpB;CA+BF"}
@@ -1,98 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import { type PreSerialized } from '../../types/streams.ts';
3
- import type { WatermarkedChange } from './change-streamer.ts';
4
- import type { Subscriber } from './subscriber.ts';
5
- export type BroadcastReleaseMode = 'all-subscribers' | 'consensus-timeout';
6
- export type PreSerializedBatch = PreSerialized & {
7
- readonly changes: readonly WatermarkedChange[];
8
- };
9
- export declare function isPreSerializedBatch(val: unknown): val is PreSerializedBatch;
10
- export declare function preSerializeBatch(changes: readonly WatermarkedChange[]): PreSerializedBatch;
11
- /**
12
- * Enables event-driven early release of a {@link Broadcast}. When provided and a
13
- * majority has acked, the broadcast schedules its own consensus-timeout release
14
- * proportional to how long the majority took to ack, instead of relying on the
15
- * Forwarder's periodic progress tick.
16
- */
17
- export type EarlyReleaseOptions = {
18
- /** Time to wait, proportional to majority completion, before releasing. */
19
- consensusTimeoutProportion: number;
20
- /** Injectable timer, for deterministic testing. */
21
- setTimeoutFn?: typeof setTimeout;
22
- /** Injectable timer cancellation, for deterministic testing. */
23
- clearTimeoutFn?: typeof clearTimeout;
24
- };
25
- /**
26
- * Initiates and tracks the progress of a change broadcasted to
27
- * a set of subscribers, implementing **consensus-based timeouts**
28
- * to effect short-term graceful degradation when a minority of
29
- * subscribers are behind.
30
- *
31
- * ### Background
32
- *
33
- * The purpose of flow control is to pull upstream replication changes
34
- * no faster than the rate they are processed by downstream subscribers
35
- * in the steady state. In the change-streamer, this is done by occasionally
36
- * waiting for ACKs from subscribers before continuing; without doing so,
37
- * I/O buffers fill up and cause the system to spend most of its time in GC.
38
- *
39
- * However, the naive algorithm of always waiting for all subscribers (e.g.
40
- * `Promise.all()`) can behave poorly in scenarios where subscribers
41
- * are imbalanced:
42
- * * New subscribers may have a backlog of changes to catch up with.
43
- * Having all subscribers wait for the new subscriber to catch up results
44
- * in delaying the entire application.
45
- * * Broken TCP connections similarly require all subscribers to wait until
46
- * connection liveness checks kick in and disconnect the subscriber.
47
- *
48
- * A simplistic approach is to add a limit to the amount of time waiting for
49
- * subscribers, i.e. an ack timeout. However, deciding what this timeout
50
- * should be is non-trivial because of the heterogeneous nature of changes;
51
- * while most changes operate on single rows and are relatively predictable
52
- * in terms of running time, some changes are table-wide operations and can
53
- * legitimately take an arbitrary amount of time. In such scenarios, a
54
- * timeout that is too short can stop progress on replication altogether.
55
- *
56
- * ### Consensus-based Timeout Algorithm
57
- *
58
- * To address these shortcomings, a "consensus-based timeout" algorithm is
59
- * used:
60
- * * Wait for more than half of the subscribers to finish. (In
61
- * case of a single node, or the case of one replication-manager
62
- * and one view-syncer, this reduces to waiting for all subscribers.)
63
- * * Once more than half of the subscribers have finished, proceed after
64
- * the configured timeout, proportional to the time it took for the
65
- * majority of subscribers to ack, even if not all subscribers have
66
- * finished.
67
- *
68
- * In other words, the subscribers themselves are used to determine the
69
- * timeout of each batch of changes; the majority determines this when
70
- * they complete, upon which a timeout is logically started.
71
- *
72
- * In the common case, the remaining subscribers finish soon afterward and
73
- * the timeout never elapses. However, in pathological cases where a minority
74
- * of subscribers have a disproportionate amount of load, some will still
75
- * be processing (or otherwise unresponsive). These subscribers are given
76
- * a bounded amount of time to catch up at each flushed batch, up to the
77
- * timeout interval. This guarantees eventual catchup because the
78
- * subscribers with a backlog of changes necessarily have a higher
79
- * processing rate than the subscribers that finished (and are made to wait).
80
- */
81
- export declare class Broadcast {
82
- #private;
83
- /**
84
- * Sends the change to the subscribers without the tracking machinery.
85
- * This is suitable for fire-and-forget (i.e. pipelined) sends.
86
- */
87
- static withoutTracking(subscribers: Iterable<Subscriber>, change: WatermarkedChange | readonly WatermarkedChange[]): void;
88
- /**
89
- * Broadcasts the `change` to the `subscribers` and tracks their
90
- * completion.
91
- */
92
- constructor(lc: LogContext, subscribers: Iterable<Subscriber>, change: WatermarkedChange | readonly WatermarkedChange[], earlyRelease?: EarlyReleaseOptions);
93
- get isDone(): boolean;
94
- get done(): Promise<void>;
95
- get releaseMode(): BroadcastReleaseMode;
96
- logSlowRequests(now: number): void;
97
- }
98
- //# sourceMappingURL=broadcast.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"broadcast.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/broadcast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAkB,KAAK,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAEhD,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAAG,mBAAmB,CAAC;AAE3E,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG;IAC/C,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAChD,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,kBAAkB,CAE5E;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,iBAAiB,EAAE,GACpC,kBAAkB,CAYpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,2EAA2E;IAC3E,0BAA0B,EAAE,MAAM,CAAC;IACnC,mDAAmD;IACnD,YAAY,CAAC,EAAE,OAAO,UAAU,CAAC;IACjC,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,YAAY,CAAC;CACtC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,qBAAa,SAAS;;IACpB;;;OAGG;IACH,MAAM,CAAC,eAAe,CACpB,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,EACjC,MAAM,EAAE,iBAAiB,GAAG,SAAS,iBAAiB,EAAE,QAOzD;IA0BD;;;OAGG;IACH,YACE,EAAE,EAAE,UAAU,EACd,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,EACjC,MAAM,EAAE,iBAAiB,GAAG,SAAS,iBAAiB,EAAE,EACxD,YAAY,CAAC,EAAE,mBAAmB,EA+BnC;IAwDD,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAExB;IAED,IAAI,WAAW,IAAI,oBAAoB,CAEtC;IAED,eAAe,CAAC,GAAG,EAAE,MAAM,QAa1B;CAiBF"}
@@ -1,34 +0,0 @@
1
- import type { ChangeStreamData } from '../change-source/protocol/current/downstream.ts';
2
- import type { ChangeTag, WatermarkedChange } from './change-streamer.ts';
3
- export type ChangeLogEntry = {
4
- watermark: string;
5
- tag: string;
6
- change: string;
7
- };
8
- export type SerializedChangeStreamData = {
9
- /** The canonical downstream representation forwarded to subscribers. */
10
- readonly json: string;
11
- /** The already-serialized change tuple element stored in change logs. */
12
- readonly change: string;
13
- };
14
- /**
15
- * Serializes a data-plane message and its stored change payload in one pass.
16
- *
17
- * Change logs retain only the second tuple element for backwards
18
- * compatibility. Serializing that element first avoids stringifying the full
19
- * message and then copying the payload back out of the resulting string on the
20
- * replication hot path.
21
- */
22
- export declare function serializeChangeStreamDataWithChange(data: ChangeStreamData): SerializedChangeStreamData;
23
- /** Serializes a data-plane message to the canonical downstream JSON form. */
24
- export declare function serializeChangeStreamData(data: ChangeStreamData): string;
25
- /**
26
- * Extracts the second tuple element for callers that only have the canonical
27
- * downstream JSON. The live write path uses
28
- * {@link serializeChangeStreamDataWithChange} and does not scan or copy the
29
- * completed message.
30
- */
31
- export declare function extractChangeSubstring(streamMessageJSON: string, tag: ChangeTag | undefined): string;
32
- /** Reconstructs the canonical downstream JSON around a stored change. */
33
- export declare function reconstructWatermarkedChange(watermark: string, entryTag: string, change: string): WatermarkedChange;
34
- //# sourceMappingURL=change-log-codec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"change-log-codec.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/change-log-codec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,iDAAiD,CAAC;AACtF,OAAO,KAAK,EAAC,SAAS,EAAE,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAEvE,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CACjD,IAAI,EAAE,gBAAgB,GACrB,0BAA0B,CAc5B;AAED,6EAA6E;AAC7E,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,iBAAiB,EAAE,MAAM,EACzB,GAAG,EAAE,SAAS,GAAG,SAAS,GACzB,MAAM,CAkBR;AAED,yEAAyE;AACzE,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,iBAAiB,CAoBnB"}
@@ -1,34 +0,0 @@
1
- /**
2
- * Pure building blocks for comparing catchup output between the Postgres and
3
- * SQLite change logs: how to reduce a catchup range to a single comparable
4
- * digest. Which transactions to sample is `isSampledForShard`, in
5
- * `shard-sampling.ts`.
6
- *
7
- * Nothing here touches either store. The comparator service supplies the
8
- * batches.
9
- */
10
- import type { WatermarkedChange } from './change-streamer.ts';
11
- export type CatchupRangeDigest = {
12
- readonly digest: string;
13
- readonly rows: number;
14
- /** Change text hashed. This is the payload cost of the range. */
15
- readonly bytes: number;
16
- /** A row or byte limit was reached before the closing commit. */
17
- readonly limitReached: boolean;
18
- };
19
- /**
20
- * Builds one ordered digest for a catchup range.
21
- *
22
- * The row position makes missing, extra, changed, and reordered rows change the digest.
23
- * The digest omits `precommit` because a commit already includes its watermark.
24
- *
25
- * The change text is hashed as stored. Both logs write the same
26
- * `extractChangeSubstring` output, and the Postgres column is `json`, which
27
- * keeps the input text exactly, so the two sides are byte-comparable without
28
- * reparsing. Comparing the stored text also catches an encoding difference
29
- * that a semantic comparison would hide.
30
- *
31
- * The read stops at `maxRows` or at `maxBytes`, whichever comes first.
32
- */
33
- export declare function digestCatchupRange(batches: AsyncIterable<readonly WatermarkedChange[]>, throughWatermark: string, maxRows: number, maxBytes: number): Promise<CatchupRangeDigest>;
34
- //# sourceMappingURL=change-log-compare-digest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"change-log-compare-digest.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/change-log-compare-digest.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,iEAAiE;IACjE,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,aAAa,CAAC,SAAS,iBAAiB,EAAE,CAAC,EACpD,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,kBAAkB,CAAC,CAsC7B"}
@@ -1,158 +0,0 @@
1
- /**
2
- * Where a stream connection's initialization parameters come from.
3
- *
4
- * A change-streamer starts a stream from three things read at one position: the
5
- * watermark to resume at, the {@link BackfillRequest}s to hand the change
6
- * source, and the cookie set those requests were derived from. Postgres has
7
- * always supplied all three (`Storer.getStartStreamInitializationParameters()`).
8
- * The point of this workstream is that a restored replica can supply them
9
- * instead, which is what lets the `cdc` schema be decommissioned.
10
- *
11
- * This is the two-source stage. Both are computed on every stream connection,
12
- * compared, and Postgres's is used — so the replica-derived path runs in
13
- * production, at full rate, before anything depends on it. The flip is
14
- * `initFromPgChangeLog: false`, not a rewrite.
15
- *
16
- * The shape is {@link UpstreamAcker}'s, deliberately: two stores, one output, a
17
- * flag per store, and the Postgres flag carrying the marker that retires it.
18
- * That class solved the identical problem for upstream ACKs earlier in this
19
- * workstream.
20
- *
21
- * ### Why the comparison is a fold and not an equality
22
- *
23
- * The replica is a subscriber downstream of the change-streamer's write loop,
24
- * so its state version trails the log's head by however long the replicator is
25
- * behind. A raw difference between the two cookie sets is therefore the normal
26
- * case and says nothing. What is checked instead is that the replica's set,
27
- * carried forward over exactly the schema changes the log holds in the interval,
28
- * equals Postgres's set at Postgres's watermark. The log holds precisely those
29
- * transactions, schema changes are rare, and the check is exact rather than
30
- * approximate — so it also happens to be the strongest available test of the
31
- * premise that three interpreters of one fold agree.
32
- */
33
- import type { LogContext } from '@rocicorp/logger';
34
- import { Database } from '../../../../zqlite/src/db.ts';
35
- import type { BackfillRequest } from '../change-source/protocol/current/upstream.ts';
36
- import { type CookieSet } from '../replicator/change-log-cookies.ts';
37
- import { type ChangeLogResumePoint } from '../replicator/change-log-db.ts';
38
- /** Everything one stream connection starts from, read at one position. */
39
- export type InitializationParameters = {
40
- readonly lastWatermark: string;
41
- readonly backfillRequests: BackfillRequest[];
42
- readonly cookies: CookieSet;
43
- };
44
- /**
45
- * - `equal` — the two stores were at the same watermark and held the same
46
- * cookies. Nothing had to be folded, which is the strongest of the four.
47
- * - `equal-after-fold` — the replica trailed, and carrying its set forward over
48
- * the log's schema changes in the interval reproduced Postgres's exactly.
49
- * The expected steady-state result.
50
- * - `divergent` — the two disagree at the same position. Alert; investigate
51
- * individually.
52
- * - `inconclusive` — the log does not span the interval, so the fold cannot be
53
- * performed. Routine on a cold log, and not a finding.
54
- * - `error` — the comparison itself failed: the replica could not be read, or
55
- * the fold threw. Not one of the four classifications, because it is a
56
- * statement about this process rather than about the two stores. Kept
57
- * separate rather than folded into `inconclusive` so that a change-streamer
58
- * that has silently stopped being able to read its replica is visible before
59
- * that read becomes the only source.
60
- */
61
- export type InitComparisonResult = 'equal' | 'equal-after-fold' | 'divergent' | 'inconclusive' | 'error';
62
- export type ChangeLogInitializerSources = {
63
- /** `Storer.getStartStreamInitializationParameters()`. */
64
- readonly pgChangeLog: () => Promise<InitializationParameters>;
65
- /** Typically {@link replicaInitializationSource}. */
66
- readonly replica: () => InitializationParameters;
67
- /**
68
- * Reconciles the SQLite change log and returns its current resume point.
69
- *
70
- * When `resumeFrom` is present, it supplies the resume point. Otherwise, a
71
- * valid log uses its own head. A new or invalid log uses `seed`.
72
- *
73
- * Returns `undefined` when the writer is disabled or unavailable.
74
- */
75
- readonly reconcileChangeLog: (resumeFrom: ChangeLogResumePoint | undefined, seed: () => ChangeLogResumePoint) => ChangeLogResumePoint | undefined;
76
- /**
77
- * The change log, for the fold. `undefined` before the stream loop's first
78
- * reconcile has created it, and again once the writer has failed soft and
79
- * deleted it — both of which make the comparison `inconclusive` rather than
80
- * an error, since neither says anything about the two stores.
81
- */
82
- readonly changeLog: () => Database | undefined;
83
- /**
84
- * Re-initializes the Postgres change log from the replica's resume point
85
- * (taking ownership of it) if it does not contain all of the replica's
86
- * changes, re-checking under lock. Typically
87
- * `Storer.reinitializeFromReplica()`.
88
- *
89
- * Supplied only when the change log's head is behind the position of the
90
- * replication slot from which replication resumes, i.e. when it may be
91
- * missing transactions that the slot will not stream. Otherwise, a replica
92
- * that is ahead of the change log (as changes are forwarded before they are
93
- * stored) is caught up by the change stream, which resumes from the change
94
- * log's head.
95
- */
96
- readonly reinitializePgChangeLog?: ((params: {
97
- watermark: string;
98
- cookies: CookieSet;
99
- }) => Promise<'reinitialized' | 'maintained'>) | undefined;
100
- };
101
- type Opts = {
102
- /**
103
- * When true, Postgres supplies the resume point and the cookies for a new
104
- * change log.
105
- *
106
- * When false, a valid log resumes from its own head. The replica supplies the
107
- * resume point for a new or invalid log.
108
- */
109
- readonly initFromPgChangeLog: boolean;
110
- /**
111
- * Derive the parameters from the replica. When Postgres is enabled, these
112
- * parameters are used only for comparison.
113
- *
114
- * When Postgres is disabled, the replica supplies the seed and the fallback
115
- * resume point.
116
- */
117
- readonly initFromReplica: boolean;
118
- };
119
- export declare class ChangeLogInitializer {
120
- #private;
121
- constructor(lc: LogContext, { initFromPgChangeLog, initFromReplica }: Opts, sources: ChangeLogInitializerSources);
122
- /**
123
- * Returns the comparison result from the most recent {@link initialize}
124
- * call. Returns `undefined` when that call used only one source.
125
- *
126
- * Tests and metrics use this result. It does not affect initialization.
127
- */
128
- lastComparison(): InitComparisonResult | undefined;
129
- /**
130
- * Returns the initialization parameters for one stream connection after it
131
- * reconciles the change log.
132
- *
133
- * The selected source determines how reconciliation works. Keeping both
134
- * operations here hides that choice from the caller.
135
- */
136
- initialize(): Promise<InitializationParameters>;
137
- }
138
- /**
139
- * Reads the replica's initialization parameters in one snapshot, which is
140
- * invariant 15 on the replica side: the state version and the cookies are only
141
- * meaningful together.
142
- */
143
- export declare function readReplicaInitializationParameters(db: Database): InitializationParameters;
144
- /**
145
- * The replica source for {@link ChangeLogInitializer}, opening and closing the
146
- * file per stream connection rather than holding a handle on a database another
147
- * process owns.
148
- *
149
- * The handle is read-only, which is invariant 19 stated in the API: the
150
- * replica's cookie tables are written by the change-processor and by nothing
151
- * else. Note that a read-only SQLite connection still needs to attach the
152
- * WAL's `-shm`, so this can fail if it opens at a moment when no writer holds
153
- * the replica; that surfaces as the `error` classification, which is the point
154
- * of running the path under observation before anything depends on it.
155
- */
156
- export declare function replicaInitializationSource(lc: LogContext, replicaFile: string): () => InitializationParameters;
157
- export {};
158
- //# sourceMappingURL=change-log-initializer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"change-log-initializer.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/change-log-initializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAIjD,OAAO,EAAC,QAAQ,EAAC,MAAM,8BAA8B,CAAC;AAKtD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAC;AAQxC,0EAA0E;AAC1E,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,gBAAgB,EAAE,eAAe,EAAE,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;CAC7B,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,oBAAoB,GAC5B,OAAO,GACP,kBAAkB,GAClB,WAAW,GACX,cAAc,GACd,OAAO,CAAC;AAEZ,MAAM,MAAM,2BAA2B,GAAG;IACxC,yDAAyD;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAC9D,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,MAAM,wBAAwB,CAAC;IACjD;;;;;;;OAOG;IACH,QAAQ,CAAC,kBAAkB,EAAE,CAC3B,UAAU,EAAE,oBAAoB,GAAG,SAAS,EAC5C,IAAI,EAAE,MAAM,oBAAoB,KAC7B,oBAAoB,GAAG,SAAS,CAAC;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,QAAQ,GAAG,SAAS,CAAC;IAC/C;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAC7B,CAAC,CAAC,MAAM,EAAE;QACR,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,SAAS,CAAC;KACpB,KAAK,OAAO,CAAC,eAAe,GAAG,YAAY,CAAC,CAAC,GAC9C,SAAS,CAAC;CACf,CAAC;AAEF,KAAK,IAAI,GAAG;IACV;;;;;;OAMG;IAEH,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;CACnC,CAAC;AAcF,qBAAa,oBAAoB;;IAqB/B,YACE,EAAE,EAAE,UAAU,EACd,EAAC,mBAAmB,EAAE,eAAe,EAAC,EAAE,IAAI,EAC5C,OAAO,EAAE,2BAA2B,EAUrC;IAED;;;;;OAKG;IACH,cAAc,IAAI,oBAAoB,GAAG,SAAS,CAEjD;IAED;;;;;;OAMG;IACG,UAAU,IAAI,OAAO,CAAC,wBAAwB,CAAC,CAqCpD;CA2JF;AAUD;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,EAAE,EAAE,QAAQ,GACX,wBAAwB,CAc1B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,UAAU,EACd,WAAW,EAAE,MAAM,GAClB,MAAM,wBAAwB,CAahC"}
@@ -1,19 +0,0 @@
1
- export type ChangeLogHashRow = {
2
- readonly watermark: string;
3
- readonly pos: number;
4
- readonly tag: string;
5
- readonly change: string;
6
- readonly precommit: string | null;
7
- };
8
- /**
9
- * Computes a stable digest over the fields shared by the Postgres and SQLite
10
- * change logs. Values are length-prefixed so different field boundaries cannot
11
- * produce the same byte stream.
12
- */
13
- export declare class ChangeLogTransactionHasher {
14
- #private;
15
- constructor();
16
- add(row: ChangeLogHashRow): void;
17
- digest(): string;
18
- }
19
- //# sourceMappingURL=change-log-transaction-hash.d.ts.map