@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.
Files changed (373) hide show
  1. package/out/zero/package.js +10 -10
  2. package/out/zero/package.js.map +1 -1
  3. package/out/zero-cache/src/auth/write-authorizer.js +9 -2
  4. package/out/zero-cache/src/auth/write-authorizer.js.map +1 -1
  5. package/out/zero-cache/src/server/change-streamer.js +1 -0
  6. package/out/zero-cache/src/server/change-streamer.js.map +1 -1
  7. package/out/zero-cache/src/services/change-source/common/replica-restore.js.map +1 -1
  8. package/out/zero-cache/src/services/change-source/pg/change-source-init.js +17 -9
  9. package/out/zero-cache/src/services/change-source/pg/change-source-init.js.map +1 -1
  10. package/out/zero-cache/src/services/change-streamer/server-start-metrics.js +1 -1
  11. package/out/zero-cache/src/services/change-streamer/server-start-metrics.js.map +1 -1
  12. package/out/zero-cache/src/services/mutagen/mutagen.js +1 -2
  13. package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
  14. package/out/zero-cache/src/services/view-syncer/view-syncer.js +19 -2
  15. package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
  16. package/out/zero-client/src/client/version.js +1 -1
  17. package/out/zero-protocol/src/inspect-down.d.ts +81 -81
  18. package/out/zero-protocol/src/up.d.ts +60 -60
  19. package/package.json +10 -10
  20. package/out/shared/src/cache.d.ts +0 -22
  21. package/out/shared/src/cache.d.ts.map +0 -1
  22. package/out/shared/src/custom-key-map.d.ts +0 -26
  23. package/out/shared/src/custom-key-map.d.ts.map +0 -1
  24. package/out/shared/src/custom-key-set.d.ts +0 -25
  25. package/out/shared/src/custom-key-set.d.ts.map +0 -1
  26. package/out/shared/src/logging-test-utils.d.ts +0 -12
  27. package/out/shared/src/logging-test-utils.d.ts.map +0 -1
  28. package/out/shared/src/queue.d.ts +0 -53
  29. package/out/shared/src/queue.d.ts.map +0 -1
  30. package/out/shared/src/ring-buffer.d.ts +0 -42
  31. package/out/shared/src/ring-buffer.d.ts.map +0 -1
  32. package/out/shared/src/sorted-entries.d.ts +0 -2
  33. package/out/shared/src/sorted-entries.d.ts.map +0 -1
  34. package/out/zero/src/server/change-streamer.d.ts +0 -2
  35. package/out/zero/src/server/change-streamer.d.ts.map +0 -1
  36. package/out/zero/src/server/main.d.ts +0 -2
  37. package/out/zero/src/server/main.d.ts.map +0 -1
  38. package/out/zero/src/server/reaper.d.ts +0 -2
  39. package/out/zero/src/server/reaper.d.ts.map +0 -1
  40. package/out/zero/src/server/replicator.d.ts +0 -2
  41. package/out/zero/src/server/replicator.d.ts.map +0 -1
  42. package/out/zero/src/server/syncer.d.ts +0 -2
  43. package/out/zero/src/server/syncer.d.ts.map +0 -1
  44. package/out/zero-cache/src/auth/jwt.d.ts +0 -12
  45. package/out/zero-cache/src/auth/jwt.d.ts.map +0 -1
  46. package/out/zero-cache/src/auth/load-permissions.d.ts +0 -17
  47. package/out/zero-cache/src/auth/load-permissions.d.ts.map +0 -1
  48. package/out/zero-cache/src/auth/write-authorizer.d.ts +0 -28
  49. package/out/zero-cache/src/auth/write-authorizer.d.ts.map +0 -1
  50. package/out/zero-cache/src/config/server-context.d.ts +0 -16
  51. package/out/zero-cache/src/config/server-context.d.ts.map +0 -1
  52. package/out/zero-cache/src/custom/fetch.d.ts +0 -38
  53. package/out/zero-cache/src/custom/fetch.d.ts.map +0 -1
  54. package/out/zero-cache/src/custom/metrics.d.ts +0 -31
  55. package/out/zero-cache/src/custom/metrics.d.ts.map +0 -1
  56. package/out/zero-cache/src/custom-queries/transform-query.d.ts +0 -68
  57. package/out/zero-cache/src/custom-queries/transform-query.d.ts.map +0 -1
  58. package/out/zero-cache/src/db/create.d.ts +0 -12
  59. package/out/zero-cache/src/db/create.d.ts.map +0 -1
  60. package/out/zero-cache/src/db/delete-lite-db.d.ts +0 -2
  61. package/out/zero-cache/src/db/delete-lite-db.d.ts.map +0 -1
  62. package/out/zero-cache/src/db/index-predicate.d.ts +0 -4
  63. package/out/zero-cache/src/db/index-predicate.d.ts.map +0 -1
  64. package/out/zero-cache/src/db/migration-lite.d.ts +0 -78
  65. package/out/zero-cache/src/db/migration-lite.d.ts.map +0 -1
  66. package/out/zero-cache/src/db/migration.d.ts +0 -80
  67. package/out/zero-cache/src/db/migration.d.ts.map +0 -1
  68. package/out/zero-cache/src/db/pg-copy-binary.d.ts +0 -101
  69. package/out/zero-cache/src/db/pg-copy-binary.d.ts.map +0 -1
  70. package/out/zero-cache/src/db/pg-copy.d.ts +0 -30
  71. package/out/zero-cache/src/db/pg-copy.d.ts.map +0 -1
  72. package/out/zero-cache/src/db/pg-type-parser.d.ts +0 -15
  73. package/out/zero-cache/src/db/pg-type-parser.d.ts.map +0 -1
  74. package/out/zero-cache/src/db/transaction-pool.d.ts +0 -205
  75. package/out/zero-cache/src/db/transaction-pool.d.ts.map +0 -1
  76. package/out/zero-cache/src/db/warmup.d.ts +0 -4
  77. package/out/zero-cache/src/db/warmup.d.ts.map +0 -1
  78. package/out/zero-cache/src/observability/events.d.ts +0 -15
  79. package/out/zero-cache/src/observability/events.d.ts.map +0 -1
  80. package/out/zero-cache/src/observability/log-throttle.d.ts +0 -44
  81. package/out/zero-cache/src/observability/log-throttle.d.ts.map +0 -1
  82. package/out/zero-cache/src/server/anonymous-otel-start.d.ts +0 -21
  83. package/out/zero-cache/src/server/anonymous-otel-start.d.ts.map +0 -1
  84. package/out/zero-cache/src/server/change-streamer.d.ts +0 -3
  85. package/out/zero-cache/src/server/change-streamer.d.ts.map +0 -1
  86. package/out/zero-cache/src/server/inspector-delegate.d.ts +0 -71
  87. package/out/zero-cache/src/server/inspector-delegate.d.ts.map +0 -1
  88. package/out/zero-cache/src/server/main.d.ts +0 -3
  89. package/out/zero-cache/src/server/main.d.ts.map +0 -1
  90. package/out/zero-cache/src/server/otel-diag-logger.d.ts +0 -16
  91. package/out/zero-cache/src/server/otel-diag-logger.d.ts.map +0 -1
  92. package/out/zero-cache/src/server/otel-start.d.ts +0 -3
  93. package/out/zero-cache/src/server/otel-start.d.ts.map +0 -1
  94. package/out/zero-cache/src/server/priority-op.d.ts +0 -8
  95. package/out/zero-cache/src/server/priority-op.d.ts.map +0 -1
  96. package/out/zero-cache/src/server/reaper.d.ts +0 -3
  97. package/out/zero-cache/src/server/reaper.d.ts.map +0 -1
  98. package/out/zero-cache/src/server/replicator.d.ts +0 -10
  99. package/out/zero-cache/src/server/replicator.d.ts.map +0 -1
  100. package/out/zero-cache/src/server/slot-keeper.d.ts +0 -26
  101. package/out/zero-cache/src/server/slot-keeper.d.ts.map +0 -1
  102. package/out/zero-cache/src/server/syncer-assigner.d.ts +0 -14
  103. package/out/zero-cache/src/server/syncer-assigner.d.ts.map +0 -1
  104. package/out/zero-cache/src/server/syncer.d.ts +0 -3
  105. package/out/zero-cache/src/server/syncer.d.ts.map +0 -1
  106. package/out/zero-cache/src/server/worker-dispatcher.d.ts +0 -17
  107. package/out/zero-cache/src/server/worker-dispatcher.d.ts.map +0 -1
  108. package/out/zero-cache/src/services/analyze.d.ts +0 -9
  109. package/out/zero-cache/src/services/analyze.d.ts.map +0 -1
  110. package/out/zero-cache/src/services/change-source/change-source.d.ts +0 -39
  111. package/out/zero-cache/src/services/change-source/change-source.d.ts.map +0 -1
  112. package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts +0 -57
  113. package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts.map +0 -1
  114. package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts +0 -55
  115. package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts.map +0 -1
  116. package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts +0 -24
  117. package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts.map +0 -1
  118. package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts +0 -140
  119. package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts.map +0 -1
  120. package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts +0 -14
  121. package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts.map +0 -1
  122. package/out/zero-cache/src/services/change-source/custom/change-source.d.ts +0 -25
  123. package/out/zero-cache/src/services/change-source/custom/change-source.d.ts.map +0 -1
  124. package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts +0 -14
  125. package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts.map +0 -1
  126. package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts +0 -36
  127. package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts.map +0 -1
  128. package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts +0 -72
  129. package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts.map +0 -1
  130. package/out/zero-cache/src/services/change-source/pg/change-source.d.ts +0 -127
  131. package/out/zero-cache/src/services/change-source/pg/change-source.d.ts.map +0 -1
  132. package/out/zero-cache/src/services/change-source/pg/fork-request.d.ts +0 -57
  133. package/out/zero-cache/src/services/change-source/pg/fork-request.d.ts.map +0 -1
  134. package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts +0 -155
  135. package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts.map +0 -1
  136. package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts +0 -17
  137. package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts.map +0 -1
  138. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts +0 -28
  139. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts.map +0 -1
  140. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts +0 -76
  141. package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts.map +0 -1
  142. package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts +0 -169
  143. package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts.map +0 -1
  144. package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts +0 -16
  145. package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts.map +0 -1
  146. package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts +0 -15
  147. package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts.map +0 -1
  148. package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts +0 -127
  149. package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts.map +0 -1
  150. package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts +0 -9
  151. package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts.map +0 -1
  152. package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts +0 -68
  153. package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts.map +0 -1
  154. package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts +0 -72
  155. package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts.map +0 -1
  156. package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts +0 -50
  157. package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts.map +0 -1
  158. package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts +0 -12
  159. package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts.map +0 -1
  160. package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts +0 -57
  161. package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts.map +0 -1
  162. package/out/zero-cache/src/services/change-streamer/broadcast.d.ts +0 -98
  163. package/out/zero-cache/src/services/change-streamer/broadcast.d.ts.map +0 -1
  164. package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts +0 -34
  165. package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts.map +0 -1
  166. package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts +0 -34
  167. package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts.map +0 -1
  168. package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts +0 -158
  169. package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts.map +0 -1
  170. package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts +0 -19
  171. package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts.map +0 -1
  172. package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts +0 -78
  173. package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts.map +0 -1
  174. package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts +0 -152
  175. package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts.map +0 -1
  176. package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts +0 -575
  177. package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts.map +0 -1
  178. package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts +0 -24
  179. package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts.map +0 -1
  180. package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts +0 -15
  181. package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts.map +0 -1
  182. package/out/zero-cache/src/services/change-streamer/forwarder.d.ts +0 -49
  183. package/out/zero-cache/src/services/change-streamer/forwarder.d.ts.map +0 -1
  184. package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts +0 -80
  185. package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts.map +0 -1
  186. package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts +0 -88
  187. package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts.map +0 -1
  188. package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts +0 -15
  189. package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts.map +0 -1
  190. package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts +0 -243
  191. package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts.map +0 -1
  192. package/out/zero-cache/src/services/change-streamer/schema/init.d.ts +0 -6
  193. package/out/zero-cache/src/services/change-streamer/schema/init.d.ts.map +0 -1
  194. package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts +0 -152
  195. package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts.map +0 -1
  196. package/out/zero-cache/src/services/change-streamer/server-start-metrics.d.ts +0 -33
  197. package/out/zero-cache/src/services/change-streamer/server-start-metrics.d.ts.map +0 -1
  198. package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts +0 -11
  199. package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts.map +0 -1
  200. package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts +0 -92
  201. package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts.map +0 -1
  202. package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts +0 -36
  203. package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts.map +0 -1
  204. package/out/zero-cache/src/services/change-streamer/snapshot.d.ts +0 -22
  205. package/out/zero-cache/src/services/change-streamer/snapshot.d.ts.map +0 -1
  206. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts +0 -99
  207. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts.map +0 -1
  208. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts +0 -83
  209. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts.map +0 -1
  210. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts +0 -121
  211. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts.map +0 -1
  212. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts +0 -73
  213. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts.map +0 -1
  214. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts +0 -62
  215. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts.map +0 -1
  216. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts +0 -114
  217. package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts.map +0 -1
  218. package/out/zero-cache/src/services/change-streamer/storer.d.ts +0 -276
  219. package/out/zero-cache/src/services/change-streamer/storer.d.ts.map +0 -1
  220. package/out/zero-cache/src/services/change-streamer/subscribe.d.ts +0 -485
  221. package/out/zero-cache/src/services/change-streamer/subscribe.d.ts.map +0 -1
  222. package/out/zero-cache/src/services/change-streamer/subscriber.d.ts +0 -205
  223. package/out/zero-cache/src/services/change-streamer/subscriber.d.ts.map +0 -1
  224. package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts +0 -52
  225. package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts.map +0 -1
  226. package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts +0 -57
  227. package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts.map +0 -1
  228. package/out/zero-cache/src/services/litestream/commands.d.ts +0 -77
  229. package/out/zero-cache/src/services/litestream/commands.d.ts.map +0 -1
  230. package/out/zero-cache/src/services/litestream/litestream-controller.d.ts +0 -78
  231. package/out/zero-cache/src/services/litestream/litestream-controller.d.ts.map +0 -1
  232. package/out/zero-cache/src/services/litestream/metrics.d.ts +0 -31
  233. package/out/zero-cache/src/services/litestream/metrics.d.ts.map +0 -1
  234. package/out/zero-cache/src/services/litestream/restore-progress.d.ts +0 -24
  235. package/out/zero-cache/src/services/litestream/restore-progress.d.ts.map +0 -1
  236. package/out/zero-cache/src/services/mutagen/mutagen.d.ts +0 -40
  237. package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +0 -1
  238. package/out/zero-cache/src/services/mutagen/pusher.d.ts +0 -63
  239. package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +0 -1
  240. package/out/zero-cache/src/services/replicator/change-log-db.d.ts +0 -368
  241. package/out/zero-cache/src/services/replicator/change-log-db.d.ts.map +0 -1
  242. package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts +0 -56
  243. package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts.map +0 -1
  244. package/out/zero-cache/src/services/replicator/change-processor.d.ts +0 -37
  245. package/out/zero-cache/src/services/replicator/change-processor.d.ts.map +0 -1
  246. package/out/zero-cache/src/services/replicator/drain-handler.d.ts +0 -82
  247. package/out/zero-cache/src/services/replicator/drain-handler.d.ts.map +0 -1
  248. package/out/zero-cache/src/services/replicator/incremental-sync.d.ts +0 -25
  249. package/out/zero-cache/src/services/replicator/incremental-sync.d.ts.map +0 -1
  250. package/out/zero-cache/src/services/replicator/notifier.d.ts +0 -9
  251. package/out/zero-cache/src/services/replicator/notifier.d.ts.map +0 -1
  252. package/out/zero-cache/src/services/replicator/replication-status.d.ts +0 -71
  253. package/out/zero-cache/src/services/replicator/replication-status.d.ts.map +0 -1
  254. package/out/zero-cache/src/services/replicator/replicator.d.ts +0 -86
  255. package/out/zero-cache/src/services/replicator/replicator.d.ts.map +0 -1
  256. package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts +0 -55
  257. package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts.map +0 -1
  258. package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts +0 -132
  259. package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts.map +0 -1
  260. package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts +0 -120
  261. package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts.map +0 -1
  262. package/out/zero-cache/src/services/replicator/write-worker-client.d.ts +0 -111
  263. package/out/zero-cache/src/services/replicator/write-worker-client.d.ts.map +0 -1
  264. package/out/zero-cache/src/services/run-ast.d.ts +0 -39
  265. package/out/zero-cache/src/services/run-ast.d.ts.map +0 -1
  266. package/out/zero-cache/src/services/runner.d.ts +0 -19
  267. package/out/zero-cache/src/services/runner.d.ts.map +0 -1
  268. package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts +0 -17
  269. package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts.map +0 -1
  270. package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts +0 -26
  271. package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts.map +0 -1
  272. package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts +0 -79
  273. package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts.map +0 -1
  274. package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +0 -97
  275. package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +0 -1
  276. package/out/zero-cache/src/services/view-syncer/client-schema.d.ts +0 -18
  277. package/out/zero-cache/src/services/view-syncer/client-schema.d.ts.map +0 -1
  278. package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts +0 -184
  279. package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts.map +0 -1
  280. package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts +0 -22
  281. package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts.map +0 -1
  282. package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +0 -128
  283. package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +0 -1
  284. package/out/zero-cache/src/services/view-syncer/cvr.d.ts +0 -294
  285. package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +0 -1
  286. package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts +0 -81
  287. package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts.map +0 -1
  288. package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts +0 -45
  289. package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts.map +0 -1
  290. package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts +0 -53
  291. package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts.map +0 -1
  292. package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts +0 -33
  293. package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts.map +0 -1
  294. package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts +0 -51
  295. package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts.map +0 -1
  296. package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts +0 -34
  297. package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts.map +0 -1
  298. package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts +0 -296
  299. package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +0 -1
  300. package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts +0 -7
  301. package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts.map +0 -1
  302. package/out/zero-cache/src/services/view-syncer/push-cost.d.ts +0 -132
  303. package/out/zero-cache/src/services/view-syncer/push-cost.d.ts.map +0 -1
  304. package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts +0 -55
  305. package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts.map +0 -1
  306. package/out/zero-cache/src/services/view-syncer/query-covering.d.ts +0 -28
  307. package/out/zero-cache/src/services/view-syncer/query-covering.d.ts.map +0 -1
  308. package/out/zero-cache/src/services/view-syncer/query-shape.d.ts +0 -25
  309. package/out/zero-cache/src/services/view-syncer/query-shape.d.ts.map +0 -1
  310. package/out/zero-cache/src/services/view-syncer/query-stats.d.ts +0 -89
  311. package/out/zero-cache/src/services/view-syncer/query-stats.d.ts.map +0 -1
  312. package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts +0 -90
  313. package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts.map +0 -1
  314. package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts +0 -17
  315. package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts.map +0 -1
  316. package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts +0 -86
  317. package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts.map +0 -1
  318. package/out/zero-cache/src/services/view-syncer/schema/init.d.ts +0 -5
  319. package/out/zero-cache/src/services/view-syncer/schema/init.d.ts.map +0 -1
  320. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +0 -563
  321. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts.map +0 -1
  322. package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts +0 -95
  323. package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts.map +0 -1
  324. package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts +0 -420
  325. package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts.map +0 -1
  326. package/out/zero-cache/src/services/view-syncer/tracer.d.ts +0 -2
  327. package/out/zero-cache/src/services/view-syncer/tracer.d.ts.map +0 -1
  328. package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts +0 -10
  329. package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts.map +0 -1
  330. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +0 -133
  331. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +0 -1
  332. package/out/zero-cache/src/types/downstream.d.ts +0 -11
  333. package/out/zero-cache/src/types/downstream.d.ts.map +0 -1
  334. package/out/zero-cache/src/types/error-with-level.d.ts +0 -9
  335. package/out/zero-cache/src/types/error-with-level.d.ts.map +0 -1
  336. package/out/zero-cache/src/types/pg-patch.d.ts +0 -21
  337. package/out/zero-cache/src/types/pg-patch.d.ts.map +0 -1
  338. package/out/zero-cache/src/types/pg-versions.d.ts +0 -3
  339. package/out/zero-cache/src/types/pg-versions.d.ts.map +0 -1
  340. package/out/zero-cache/src/types/poke-chunk.d.ts +0 -18
  341. package/out/zero-cache/src/types/poke-chunk.d.ts.map +0 -1
  342. package/out/zero-cache/src/types/streams.d.ts +0 -115
  343. package/out/zero-cache/src/types/streams.d.ts.map +0 -1
  344. package/out/zero-cache/src/types/subscription.d.ts +0 -197
  345. package/out/zero-cache/src/types/subscription.d.ts.map +0 -1
  346. package/out/zero-cache/src/workers/connect-params.d.ts +0 -28
  347. package/out/zero-cache/src/workers/connect-params.d.ts.map +0 -1
  348. package/out/zero-cache/src/workers/connection.d.ts +0 -77
  349. package/out/zero-cache/src/workers/connection.d.ts.map +0 -1
  350. package/out/zero-cache/src/workers/replicator.d.ts +0 -57
  351. package/out/zero-cache/src/workers/replicator.d.ts.map +0 -1
  352. package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts +0 -14
  353. package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts.map +0 -1
  354. package/out/zero-cache/src/workers/syncer.d.ts +0 -67
  355. package/out/zero-cache/src/workers/syncer.d.ts.map +0 -1
  356. package/out/zero-events/src/index.d.ts +0 -27
  357. package/out/zero-events/src/index.d.ts.map +0 -1
  358. package/out/zero-events/src/json.d.ts +0 -20
  359. package/out/zero-events/src/json.d.ts.map +0 -1
  360. package/out/zero-events/src/status.d.ts +0 -144
  361. package/out/zero-events/src/status.d.ts.map +0 -1
  362. package/out/zqlite/src/database-storage.d.ts +0 -43
  363. package/out/zqlite/src/database-storage.d.ts.map +0 -1
  364. package/out/zqlite/src/explain-queries.d.ts +0 -4
  365. package/out/zqlite/src/explain-queries.d.ts.map +0 -1
  366. package/out/zqlite/src/internal/sql-inline.d.ts +0 -13
  367. package/out/zqlite/src/internal/sql-inline.d.ts.map +0 -1
  368. package/out/zqlite/src/resolve-scalar-subqueries.d.ts +0 -72
  369. package/out/zqlite/src/resolve-scalar-subqueries.d.ts.map +0 -1
  370. package/out/zqlite/src/sqlite-cost-model.d.ts +0 -17
  371. package/out/zqlite/src/sqlite-cost-model.d.ts.map +0 -1
  372. package/out/zqlite/src/sqlite-stat-fanout.d.ts +0 -121
  373. package/out/zqlite/src/sqlite-stat-fanout.d.ts.map +0 -1
@@ -1,49 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { Status, WatermarkedChange } from './change-streamer.ts';
3
- import type { Subscriber } from './subscriber.ts';
4
- export type ProgressMonitorOptions = {
5
- flowControlConsensusTimeoutProportion: number;
6
- flowControlSlowSubscriberGracePeriodMs?: number | undefined;
7
- setTimeoutFn?: typeof setTimeout | undefined;
8
- clearTimeoutFn?: typeof clearTimeout | undefined;
9
- };
10
- export declare class Forwarder {
11
- #private;
12
- constructor(lc: LogContext, opts?: ProgressMonitorOptions);
13
- startProgressMonitor(): void;
14
- /**
15
- * Runs one progress-monitor tick: samples each active subscriber's change
16
- * rate, logs slow broadcasts, and disconnects subscribers that have been
17
- * continuously lagging for longer than the configured grace period.
18
- *
19
- * Invoked on an interval by {@link startProgressMonitor()}; exposed (rather
20
- * than private) so tests can drive a single tick with an explicit `now`.
21
- */
22
- checkSubscriberProgress(now: number): void;
23
- stopProgressMonitor(): void;
24
- /**
25
- * `add()` is called in lock step with `Storer.catchup()` so that the
26
- * two components have an equivalent interpretation of whether a Transaction is
27
- * currently being streamed.
28
- */
29
- add(sub: Subscriber): void;
30
- remove(sub: Subscriber): void;
31
- /**
32
- * `forward()` is called in lockstep with `Storer.store()` so that the
33
- * two components have an equivalent interpretation of whether a Transaction is
34
- * currently being streamed.
35
- *
36
- * This version of forward buffers changes across the current event loop turn
37
- * and dispatches them in batches. The change-streamer should call and await
38
- * {@link forwardWithFlowControl()} occasionally to avoid memory blowup.
39
- */
40
- forward(entry: WatermarkedChange): void;
41
- sendStatus(status: Status): void;
42
- /**
43
- * The flow-control-aware equivalent of {@link forward()}, returning a
44
- * Promise that resolves when replication should continue.
45
- */
46
- forwardWithFlowControl(entry: WatermarkedChange): Promise<void>;
47
- getAcks(): Set<string>;
48
- }
49
- //# sourceMappingURL=forwarder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forwarder.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/forwarder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAQjD,OAAO,KAAK,EAAY,MAAM,EAAE,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAE/E,OAAO,KAAK,EAAC,UAAU,EAAkB,MAAM,iBAAiB,CAAC;AAEjE,MAAM,MAAM,sBAAsB,GAAG;IACnC,qCAAqC,EAAE,MAAM,CAAC;IAC9C,sCAAsC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5D,YAAY,CAAC,EAAE,OAAO,UAAU,GAAG,SAAS,CAAC;IAC7C,cAAc,CAAC,EAAE,OAAO,YAAY,GAAG,SAAS,CAAC;CAClD,CAAC;AAIF,qBAAa,SAAS;;IAmCpB,YACE,EAAE,EAAE,UAAU,EACd,IAAI,GAAE,sBAEL,EA6DF;IAED,oBAAoB,SAMnB;IAED;;;;;;;OAOG;IACH,uBAAuB,CAAC,GAAG,EAAE,MAAM,QA6DlC;IAED,mBAAmB,SAGlB;IAED;;;;OAIG;IACH,GAAG,CAAC,GAAG,EAAE,UAAU,QAOlB;IAED,MAAM,CAAC,GAAG,EAAE,UAAU,QAKrB;IAED;;;;;;;;OAQG;IACH,OAAO,CAAC,KAAK,EAAE,iBAAiB,QAmB/B;IAED,UAAU,CAAC,MAAM,EAAE,MAAM,QAKxB;IAED;;;OAGG;IACG,sBAAsB,CAAC,KAAK,EAAE,iBAAiB,iBA4BpD;IAkED,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,CAOrB;CACF"}
@@ -1,80 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { Source } from '../../types/streams.ts';
3
- import { LitestreamController } from '../litestream/litestream-controller.ts';
4
- import type { BackedUpWatermark, BackupPoller } from './backup-monitor.ts';
5
- /**
6
- * How often the local replica is polled while a requested sync (see
7
- * {@link LitestreamSyncRequester.requestSync}) waits for the replica to reach
8
- * the requested watermark. Each poll is a single read of the replica's
9
- * watermark, which the replica typically reaches within a poll or two.
10
- */
11
- export declare const EXPEDITED_POLL_INTERVAL_MS = 50;
12
- /** The subset of {@link LitestreamController} used by the requester. */
13
- export type SyncController = Pick<LitestreamController, 'sync' | 'close'>;
14
- export type SyncRequesterConfig = {
15
- /**
16
- * Interval between sync requests. This paces how often litestream seals
17
- * (and uploads) a new LTX file.
18
- */
19
- intervalMs: number;
20
- };
21
- /**
22
- * The LitestreamSyncRequester drives litestream v5 backups and tracks which
23
- * replica watermark is durably backed up, emitting it as a stream of
24
- * {@link BackedUpWatermark}s.
25
- *
26
- * It periodically reads the replica's current watermark `W` and then asks
27
- * litestream to sync and wait for the upload (`POST /sync {wait: true}`).
28
- * litestream satisfies the request with a sync pass that *starts after* the
29
- * request, and a pass syncs up to the end of the WAL, so a successful response
30
- * means that every transaction committed before the request, including the
31
- * one that wrote `W`, has been uploaded to the backup. No part of the backup
32
- * needs to be read to determine this.
33
- *
34
- * Requests continue even when `W` is already backed up, so that changes that
35
- * don't advance the watermark (e.g. change-log cleanup or `PRAGMA optimize`)
36
- * are also backed up at this cadence rather than only at litestream's slower
37
- * backstop interval. A request on an idle replica is a local no-op for
38
- * litestream: there is nothing to seal or upload, and no backup reads.
39
- *
40
- * At most one request is outstanding at a time. Failed or timed-out requests
41
- * are retried with a backoff that starts short and, once it grows to the
42
- * interval, defers to the regular ticks. Nothing is published until a request
43
- * succeeds.
44
- *
45
- * A sync through a specific watermark can also be requested out of band (see
46
- * {@link requestSync}), e.g. when a replica fork waits on its backup.
47
- */
48
- export declare class LitestreamSyncRequester implements BackupPoller {
49
- #private;
50
- constructor(lc: LogContext, replicaFile: string, config: SyncRequesterConfig, litestream?: SyncController);
51
- /**
52
- * Starts requesting syncs and pushes backed-up watermarks to the returned
53
- * stream. Must only be called once.
54
- *
55
- * The replica is only opened here, so that a requester that is never
56
- * started holds no resources.
57
- */
58
- start(): Source<BackedUpWatermark>;
59
- /**
60
- * Requests a sync unless a request is already outstanding. Resolves when
61
- * this tick's request (or the outstanding one) completes.
62
- * Exported for testing.
63
- */
64
- readonly tick: () => Promise<void>;
65
- /**
66
- * Requests a sync through `watermark` as soon as the local replica has
67
- * reached it, rather than at the next regular tick.
68
- *
69
- * The replica is polled every {@link EXPEDITED_POLL_INTERVAL_MS} until its
70
- * watermark reaches the target, after which a sync is requested
71
- * immediately (or once the outstanding request, which may predate the
72
- * target, completes). A failed request is retried with the usual backoff.
73
- * Concurrent requests are coalesced into one, for the latest target.
74
- *
75
- * If the replica does not reach the target within the configured interval,
76
- * the request is dropped, as the regular ticks then cover it anyway.
77
- */
78
- requestSync(watermark: string): void;
79
- }
80
- //# sourceMappingURL=litestream-sync-requester.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"litestream-sync-requester.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/litestream-sync-requester.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAKjD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAC,oBAAoB,EAAC,MAAM,wCAAwC,CAAC;AAE5E,OAAO,KAAK,EAAC,iBAAiB,EAAE,YAAY,EAAC,MAAM,qBAAqB,CAAC;AA6BzE;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAS7C,wEAAwE;AACxE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;AAE1E,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,uBAAwB,YAAW,YAAY;;IAoB1D,YACE,EAAE,EAAE,UAAU,EACd,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,mBAAmB,EAC3B,UAAU,GAAE,cAA0D,EAgBvE;IAED;;;;;;OAMG;IACH,KAAK,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAYjC;IAED;;;;OAIG;IACH,QAAQ,CAAC,IAAI,QAAO,OAAO,CAAC,IAAI,CAAC,CAY/B;IAcF;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,QAa5B;CA+FF"}
@@ -1,88 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { Source } from '../../types/streams.ts';
3
- import type { BackedUpWatermark, BackupPoller } from './backup-monitor.ts';
4
- export declare const CHECK_INTERVAL_MS = 10000;
5
- /**
6
- * Allowance for clock skew between the machine reporting litestream metrics
7
- * and the timestamps reported by the backup destination (e.g. S3).
8
- */
9
- export declare const BACKUP_VERIFICATION_SLACK_MS = 60000;
10
- /**
11
- * How long the actual backup state may remain *continuously* behind the
12
- * backup progress claimed by litestream metrics before the backup is
13
- * considered genuinely wedged and the process is shut down.
14
- *
15
- * A wedged backup is dangerous: litestream believes it is making durable
16
- * progress when it is not, which can silently corrupt the backup (the WAL
17
- * format only makes *some* such gaps detectable). Once that is confirmed to
18
- * be the persistent state, continuing to run is worse than crashing, so the
19
- * process exits loudly (non-zero, with a logged error) and the wedged backup
20
- * destination becomes the priority to investigate.
21
- *
22
- * The change-log is conservatively *not* purged for the entire time the
23
- * backup is stale, so the only cost of a generous grace period is unbounded
24
- * change-log growth. We therefore err well on the side of slack: the backup
25
- * must stay stuck across many {@link CHECK_INTERVAL_MS} checks before we tear
26
- * the server down, so that a transient hiccup (a slow or briefly unreachable
27
- * destination, or litestream restarting) does not trigger a shutdown. The
28
- * staleness clock is reset the moment a purge is confirmed against a real
29
- * upload.
30
- */
31
- export declare const WEDGED_SHUTDOWN_GRACE_MS: number;
32
- /**
33
- * How long the BackupMonitor waits for the *first* restorable backup to appear
34
- * before concluding that the backup pipeline is broken and shutting the process
35
- * down (see {@link BackupMonitor.#shutDownOnMissingInitialBackup}).
36
- *
37
- * On a fresh stack the first backup is not restorable until the initial
38
- * Postgres->replica sync completes and litestream finishes uploading the
39
- * initial snapshot — a multipart upload that is not listable in the destination
40
- * until it is committed. The producer cannot observe that sub-snapshot progress,
41
- * so this is necessarily a generous timeout. It is scaled by replica size to
42
- * mirror the platform's storage-scaled startup-probe allowance (~1 hour per
43
- * 50GB) so that it never fires before the platform would restart a view-syncer
44
- * that is waiting on the backup.
45
- */
46
- export declare const INITIAL_BACKUP_GRACE_MS_PER_UNIT: number;
47
- /**
48
- * How often the BackupMonitor re-checks whether the first restorable backup has
49
- * appeared while a view-syncer holds a snapshot reservation open during a cold
50
- * start.
51
- */
52
- export declare const RESTORABLE_BACKUP_POLL_INTERVAL_MS = 10000;
53
- /**
54
- * Returns the time of the most recent object actually uploaded to the
55
- * backup replica destination (e.g. as determined by listing the snapshots
56
- * and WAL segments in S3). Rejects if the backup state cannot be determined.
57
- *
58
- * See `getLastBackupTime()` in `../litestream/commands.ts` for the
59
- * production implementation.
60
- */
61
- export type BackupStateVerifier = () => Promise<Date>;
62
- /**
63
- * The Litestream3PrometheusPoller polls the litestream "/metrics" endpoint to
64
- * track the watermark (label) value of the `litestream_replica_progress` gauge
65
- * and emits verified watermarks to a stream of {@link BackedUpWatermark}s.
66
- *
67
- * See: https://github.com/rocicorp/litestream/pull/3
68
- *
69
- * Because the watermarks reported by litestream metrics reflect what
70
- * litestream *believes* has been backed up (which has been observed to
71
- * diverge from reality when uploads silently fail), the cleanup watermark is
72
- * only published after verifying it against the actual backup state in the
73
- * replica destination via a {@link BackupStateVerifier}. If the
74
- * actual backup state stays behind the claimed progress for longer than
75
- * {@link WEDGED_SHUTDOWN_GRACE_MS}, the backup is treated as wedged and the
76
- * process is shut down rather than risk corrupting the backup.
77
- */
78
- export declare class Litestream3PrometheusPoller implements BackupPoller {
79
- #private;
80
- constructor(lc: LogContext, replicaFile: string, backupURL: string, metricsEndpoint: string, verifyBackupState: BackupStateVerifier);
81
- /**
82
- * Starts polling for watermarks and pushes new ones to returned stream.
83
- * Must only be called once.
84
- */
85
- start(): Source<BackedUpWatermark>;
86
- readonly checkVerifyAndPublishWatermarks: () => Promise<void>;
87
- }
88
- //# sourceMappingURL=litestream3-prometheus-poller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"litestream3-prometheus-poller.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/litestream3-prometheus-poller.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAMjD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAOnD,OAAO,KAAK,EAAC,iBAAiB,EAAE,YAAY,EAAC,MAAM,qBAAqB,CAAC;AAEzE,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,wBAAwB,QAAc,CAAC;AAIpD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gCAAgC,QAAc,CAAC;AAG5D;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,QAAS,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,2BAA4B,YAAW,YAAY;;IAuC9D,YACE,EAAE,EAAE,UAAU,EACd,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,iBAAiB,EAAE,mBAAmB,EAavC;IAED;;;OAGG;IACH,KAAK,IAAI,MAAM,CAAC,iBAAiB,CAAC,CASjC;IAqBD,QAAQ,CAAC,+BAA+B,sBAgBtC;CAmSH"}
@@ -1,15 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { Source } from '../../types/streams.ts';
3
- import type { BackedUpWatermark, BackupPoller } from './backup-monitor.ts';
4
- /**
5
- * The single-node equivalent of a backup monitor polls the replica file every
6
- * 30 seconds and schedules cleanup when the watermark
7
- * (i.e. stateVersion) moves forward.
8
- */
9
- export declare class ReplicaPoller implements BackupPoller {
10
- #private;
11
- readonly id = "replica-poller";
12
- constructor(lc: LogContext, replicaFile: string);
13
- start(): Source<BackedUpWatermark>;
14
- }
15
- //# sourceMappingURL=replica-poller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replica-poller.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/replica-poller.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAGjD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,wBAAwB,CAAC;AAGnD,OAAO,KAAK,EAAC,iBAAiB,EAAE,YAAY,EAAC,MAAM,qBAAqB,CAAC;AAIzE;;;;GAIG;AACH,qBAAa,aAAc,YAAW,YAAY;;IAChD,QAAQ,CAAC,EAAE,oBAAoB;IAQ/B,YAAY,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAM9C;IAED,KAAK,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAQjC;CAiBF"}
@@ -1,243 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { LocalReplica } from './subscribe.ts';
3
- /**
4
- * The default time to wait for a subscriber that was granted permission to
5
- * restore to reconnect (i.e. to open a replacement reservation) after its
6
- * held connection closes, or after its replacement reservation closes
7
- * without subscribing (e.g. to retry a failed restore). This covers the
8
- * subscriber's process exit and restart (e.g. a container restart, the
9
- * backoff of which starts at 10 seconds in Kubernetes), but not the restore
10
- * itself, which is tracked by the liveness of its snapshot reservation.
11
- */
12
- export declare const DEFAULT_PENDING_GRANT_TTL_MS = 90000;
13
- /**
14
- * The default time for which a replacement continues to be counted after its
15
- * subscriber has caught up, which covers the time for the subscriber to start
16
- * serving (i.e. become ready) after catching up. See
17
- * {@link RestoreAdmissionOptions.readinessGracePeriodMs}.
18
- */
19
- export declare const DEFAULT_READINESS_GRACE_PERIOD_MS = 5000;
20
- export type RestoreAdmissionOptions = {
21
- /** The replica version of the replication-manager. */
22
- replicaVersion: string;
23
- /**
24
- * The maximum number of subscribers that may be restoring (or granted
25
- * permission to restore) at the same time.
26
- */
27
- maxConcurrentRestores: number;
28
- pendingGrantTTLMs?: number | undefined;
29
- /**
30
- * The time for which a replacement continues to be counted after its
31
- * subscriber has caught up, so that the next subscriber is not granted
32
- * permission to restore (and stop serving) before the restored one has
33
- * started serving. Catching up is followed by the subscriber's readiness
34
- * checks (e.g. waiting for the next replication lag report), and by the
35
- * container runner's detection of its readiness.
36
- */
37
- readinessGracePeriodMs?: number | undefined;
38
- setTimeoutFn?: typeof setTimeout | undefined;
39
- clearTimeoutFn?: typeof clearTimeout | undefined;
40
- };
41
- export type AdmissionRequest = {
42
- /**
43
- * Called when the request is queued, and again whenever its (1-based)
44
- * position in the queue changes.
45
- */
46
- onQueued: (position: number) => void;
47
- /** Called (once) when the request is granted. */
48
- onGranted: () => void;
49
- };
50
- /** A subscribed replacement, returned by {@link RestoreAdmission.reservationSubscribed}. */
51
- export type Replacement = {
52
- /**
53
- * Called when the subscriber has caught up. The replacement is released
54
- * after the readiness grace period.
55
- */
56
- caughtUp: () => void;
57
- /** Called when the subscription closes. The replacement is released. */
58
- closed: () => void;
59
- };
60
- export type AdmissionTicket = {
61
- /**
62
- * Must be called when the requesting connection closes. A queued request
63
- * is removed from the queue. For a granted request, this starts the
64
- * timer within which the subscriber is expected to reconnect and open a
65
- * replacement reservation.
66
- */
67
- release(): void;
68
- };
69
- /**
70
- * Limits the number of view-syncers that replace their replica at the same
71
- * time, so that view-syncers switching over from an incompatible
72
- * replication-manager (e.g. after a resync) do not all stop serving at once.
73
- *
74
- * Capacity is consumed by:
75
- * * Replacement restores: snapshot reservations of subscribers that are
76
- * replacing an (incompatible or outdated) local replica, i.e. subscribers
77
- * that were serving. Restores onto an empty disk (e.g. a new pod) do not
78
- * take a serving subscriber out of service, and are not counted. The
79
- * reservation's connection is held open for the duration of the restore,
80
- * and the subscription that follows it is held open until the restored
81
- * subscriber has caught up, so their liveness tracks that of the
82
- * replacement without a timeout.
83
- * * Outstanding grants: permission to restore that has not yet been
84
- * followed by a replacement reservation (e.g. while the subscriber drains
85
- * and restarts). Grants are not matched to reservations by identity:
86
- * any replacement reservation consumes an outstanding grant, and a grant
87
- * that is not consumed expires a short time after the granted connection
88
- * closes (e.g. if the subscriber reconnected to a different
89
- * replication-manager or was deleted).
90
- *
91
- * ## Life cycle of a switchover restore
92
- *
93
- * The following traces a view-syncer (VS) with a replica at version `R1`,
94
- * served by an old replication-manager (RM) at `R1`, while a new RM (e.g.
95
- * after a resync) is at `R2 > R1`. The RestoreAdmission is that of the new
96
- * RM. Terms in `code` are those used in the code.
97
- *
98
- * 1. **Drain.** The old RM receives a SIGTERM, and its `DrainTracker` sends
99
- * `status {draining: true}` to its `drainable` (i.e. serving) subscribers.
100
- * It continues to stream changes to them, and exits once they have all
101
- * disconnected.
102
- *
103
- * 2. **Switchover.** The VS's `DrainHandler` opens a second `/subscribe`
104
- * with `switchover: true` at the watermark of its last committed
105
- * transaction, which is routed to some RM. The VS continues to consume
106
- * the old RM's stream. If the RM is compatible (i.e. another old RM),
107
- * the subscription is accepted and the VS simply moves to it. If the RM
108
- * is the new one, the subscriber's replica version is older, and the
109
- * subscription proceeds to step 3.
110
- *
111
- * 3. **Queued.** `ChangeStreamerImpl.subscribe()` holds the subscription
112
- * (it is not added to the forwarder) and calls {@link request}. The
113
- * request is `queued` and `onQueued(position)` sends
114
- * `status {restore: {state: 'queued', position}}`, again whenever the
115
- * position changes. If the held connection closes while queued (e.g.
116
- * the VS's old stream ended and it gave up on the switchover), the
117
- * ticket is `release()`d and the request leaves the queue.
118
- *
119
- * 4. **Granted.** When the number in flight (`replacing` + `granted`) is
120
- * below `maxConcurrentRestores`, the head of the queue is `granted`: a
121
- * {@link Grant} is added (counting toward capacity), and `onGranted()`
122
- * sends `status {restore: {state: 'granted'}}`. The VS keeps the granted
123
- * connection open, and initiates a self-drain (`drainRequested`): it
124
- * fails its health checks, drains its clients, and keeps replicating
125
- * from the old RM in the meantime.
126
- *
127
- * 5. **Restart.** The VS process exits, closing the granted connection.
128
- * The ticket is `release()`d, marking the grant as `released` and
129
- * starting the pending grant TTL ({@link DEFAULT_PENDING_GRANT_TTL_MS}),
130
- * within which a replacement reservation is expected. The drain itself
131
- * does not count against the TTL.
132
- *
133
- * 6. **Reservation opened.** The restarted VS sends
134
- * `reserve-snapshot {taskID, localReplica}`, and
135
- * `ChangeStreamerImpl.startSnapshotReservation()` calls
136
- * {@link reservationOpened}:
137
- * * A `localReplica` of a different replica version (e.g. `R1`) is
138
- * `replacing`: the reservation is counted, and consumes an outstanding
139
- * grant (preferring a `released` one), so the number in flight is
140
- * unchanged.
141
- * * A `localReplica` of the same replica version is `unclassified` until
142
- * the reservation is confirmed ({@link reservationConfirmed}) with the
143
- * backup's minimum watermark. It is `replacing` if its watermark is
144
- * older (i.e. it cannot catch up from the change log).
145
- * * No `localReplica` (an empty disk) is not counted.
146
- *
147
- * If the VS reached a different RM instead, the grant here expires after
148
- * the TTL and frees its capacity, while the replacement is counted (as
149
- * an ungranted one) by the RM that it reached.
150
- *
151
- * 7. **Restoring.** The VS restores the backup while holding the
152
- * reservation's connection open. A retried reservation from the same
153
- * task that arrives while the previous one is still open replaces it
154
- * (`SnapshotReservations` `onClose`) but does not end it (`onEnd`), so it
155
- * remains `replacing`. If the reservation instead closes without
156
- * subscribing (e.g. a failed or disconnected restore, after which the VS
157
- * retries), {@link reservationClosed} converts its capacity into a
158
- * `released` grant, which the retry's replacement reservation consumes
159
- * (step 6), or which expires after the pending grant TTL (e.g. if the VS
160
- * was deleted).
161
- *
162
- * 8. **Subscribed.** Once restored, the VS subscribes on the same
163
- * connection at `R2`, which is accepted. `ChangeStreamerImpl.subscribe()`
164
- * calls {@link reservationSubscribed}, which moves the replacement from
165
- * its reservation (the key leaves `replacing`) to the subscription
166
- * (`catchingUp`), and then closes the task's reservation. Its `onEnd`
167
- * calls {@link reservationClosed}, which is a no-op for the moved key.
168
- *
169
- * 9. **Caught up.** The VS catches up on the change stream from the
170
- * backup's watermark. Once it has acked all changes up to the head of
171
- * the stream (`Subscriber.caughtUp`), the replacement is released after
172
- * the readiness grace period, which covers the time for the VS to start
173
- * serving, and the next queued request is granted. If the VS disconnects
174
- * first, the replacement is released immediately.
175
- *
176
- * A VS that restarts outside of a switchover with an incompatible replica
177
- * (e.g. after a crash) enters at step 6 without a grant, and its restore
178
- * consumes capacity all the same, delaying queued requests.
179
- *
180
- * ## States
181
- *
182
- * | Term | Where | Meaning |
183
- * | ------------- | ------------------------ | -------------------------------- |
184
- * | queued | `Entry.state` | Held, waiting for capacity |
185
- * | granted | `Entry.state`, `#grants` | Permitted to restore, pending a |
186
- * | | | replacement reservation |
187
- * | released | `Entry.state` | The held connection closed |
188
- * | released | `Grant.released` | The granted connection, or an |
189
- * | | | unsubscribed replacement |
190
- * | | | reservation, closed; the TTL is |
191
- * | | | running |
192
- * | unclassified | `#unclassified` | Same-version reservation, not |
193
- * | | | yet confirmed |
194
- * | replacing | `#replacing` | Open replacement reservation |
195
- * | catching up | `#catchingUp` | Subscribed replacement, not yet |
196
- * | | | caught up (or within the |
197
- * | | | readiness grace period) |
198
- * | in flight | `#inFlight` | `replacing` + `catchingUp` + |
199
- * | | | `granted`, bounded by |
200
- * | | | `maxConcurrentRestores` |
201
- */
202
- export declare class RestoreAdmission {
203
- #private;
204
- constructor(lc: LogContext, opts: RestoreAdmissionOptions);
205
- /** For testing and logging. */
206
- get stats(): {
207
- replacing: number;
208
- granted: number;
209
- queued: number;
210
- };
211
- /**
212
- * Called when a snapshot reservation is opened by a subscriber with the
213
- * given `localReplica` (if any). A subscriber with a local replica of a
214
- * different replica version is replacing it. One with the same replica
215
- * version is replacing it if it is outdated, which is determined by
216
- * {@link reservationConfirmed}. Idempotent for the same `key` (e.g. a
217
- * retried reservation).
218
- */
219
- reservationOpened(key: string, localReplica: LocalReplica | undefined): void;
220
- /**
221
- * Called when a reservation is confirmed with the minimum watermark of the
222
- * replica to restore.
223
- */
224
- reservationConfirmed(key: string, minWatermark: string): void;
225
- /**
226
- * Called when a reservation ends. A replacement reservation normally ends
227
- * after its task subscribes ({@link reservationSubscribed}), in which case
228
- * this is a no-op. A replacement reservation that ends without subscribing
229
- * (e.g. a failed or disconnected restore) is most likely followed by a
230
- * retry, so its capacity is retained as a released grant (which the retry
231
- * consumes) rather than released immediately.
232
- */
233
- reservationClosed(key: string): void;
234
- /**
235
- * Called when the task of a reservation subscribes (before the reservation
236
- * is closed). If the reservation is a replacement, it continues to be
237
- * counted until the readiness grace period after the subscriber has caught
238
- * up, or until the subscription closes.
239
- */
240
- reservationSubscribed(key: string): Replacement | undefined;
241
- request(request: AdmissionRequest): AdmissionTicket;
242
- }
243
- //# sourceMappingURL=restore-admission.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"restore-admission.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/change-streamer/restore-admission.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,OAAQ,CAAC;AAEvD,MAAM,MAAM,uBAAuB,GAAG;IACpC,sDAAsD;IACtD,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5C,YAAY,CAAC,EAAE,OAAO,UAAU,GAAG,SAAS,CAAC;IAC7C,cAAc,CAAC,EAAE,OAAO,YAAY,GAAG,SAAS,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC,iDAAiD;IACjD,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,4FAA4F;AAC5F,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,wEAAwE;IACxE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB,CAAC;AAeF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoIG;AACH,qBAAa,gBAAgB;;IAwB3B,YAAY,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,uBAAuB,EAqBxD;IAMD,+BAA+B;IAC/B,IAAI,KAAK;QAEL,SAAS;QACT,OAAO;QACP,MAAM;MAET;IAED;;;;;;;OAOG;IACH,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,SAAS,QAUpE;IAED;;;OAGG;IACH,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,QAMrD;IAED;;;;;;;OAOG;IACH,iBAAiB,CAAC,GAAG,EAAE,MAAM,QAO5B;IAED;;;;;OAKG;IACH,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAwB1D;IAiBD,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAKlD;CAoDF"}
@@ -1,6 +0,0 @@
1
- import type { LogContext } from '@rocicorp/logger';
2
- import type { PostgresDB } from '../../../types/pg.ts';
3
- import { type ShardID } from '../../../types/shards.ts';
4
- export declare function initChangeStreamerSchema(log: LogContext, db: PostgresDB, shard: ShardID): Promise<void>;
5
- export declare function getLastWatermarkV2(db: PostgresDB, shard: ShardID): Promise<string>;
6
- //# sourceMappingURL=init.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../../zero-cache/src/services/change-streamer/schema/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAMjD,OAAO,KAAK,EAAC,UAAU,EAAsB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAY,KAAK,OAAO,EAAC,MAAM,0BAA0B,CAAC;AA+BjE,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,UAAU,EACf,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,IAAI,CAAC,CA0Ef;AAED,wBAAsB,kBAAkB,CACtC,EAAE,EAAE,UAAU,EACd,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,MAAM,CAAC,CAajB"}