@intentius/chant-lexicon-sql 0.114.1 → 0.115.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/clickhouse/apply/mutations.d.ts +7 -1
  2. package/dist/clickhouse/apply/mutations.d.ts.map +1 -1
  3. package/dist/clickhouse/container.d.ts +22 -7
  4. package/dist/clickhouse/container.d.ts.map +1 -1
  5. package/dist/clickhouse/plan/deep.d.ts +5 -0
  6. package/dist/clickhouse/plan/deep.d.ts.map +1 -1
  7. package/dist/clickhouse/plan/normalize.d.ts.map +1 -1
  8. package/dist/clickhouse/rebuild/backfill.d.ts +11 -5
  9. package/dist/clickhouse/rebuild/backfill.d.ts.map +1 -1
  10. package/dist/clickhouse/rebuild/op.d.ts +29 -0
  11. package/dist/clickhouse/rebuild/op.d.ts.map +1 -1
  12. package/dist/clickhouse/rebuild/partitions.d.ts +8 -0
  13. package/dist/clickhouse/rebuild/partitions.d.ts.map +1 -1
  14. package/dist/clickhouse/rebuild/receipts.d.ts +4 -6
  15. package/dist/clickhouse/rebuild/receipts.d.ts.map +1 -1
  16. package/dist/clickhouse/rebuild/shards.d.ts +59 -0
  17. package/dist/clickhouse/rebuild/shards.d.ts.map +1 -0
  18. package/dist/clickhouse/rebuild/steps.d.ts +3 -0
  19. package/dist/clickhouse/rebuild/steps.d.ts.map +1 -1
  20. package/dist/clickhouse/rebuild/verify.d.ts +4 -0
  21. package/dist/clickhouse/rebuild/verify.d.ts.map +1 -1
  22. package/dist/config.d.ts +14 -0
  23. package/dist/config.d.ts.map +1 -1
  24. package/dist/core/receipts.d.ts +5 -3
  25. package/dist/core/receipts.d.ts.map +1 -1
  26. package/dist/integrity.json +2 -2
  27. package/dist/manifest.json +1 -1
  28. package/dist/op/activities/clickhouse-rebuild.d.ts.map +1 -1
  29. package/dist/op/activities/index.d.ts +13 -1
  30. package/dist/op/activities/index.d.ts.map +1 -1
  31. package/dist/op/activities/sql-exec.d.ts +41 -0
  32. package/dist/op/activities/sql-exec.d.ts.map +1 -0
  33. package/dist/op/activity-contracts.d.ts +20 -0
  34. package/dist/op/activity-contracts.d.ts.map +1 -1
  35. package/dist/postgres/live/catalog.d.ts +1 -1
  36. package/dist/postgres/live/catalog.d.ts.map +1 -1
  37. package/dist/postgres/migrate/receipts.d.ts +8 -5
  38. package/dist/postgres/migrate/receipts.d.ts.map +1 -1
  39. package/dist/receipts.d.ts +102 -0
  40. package/dist/receipts.d.ts.map +1 -0
  41. package/package.json +2 -2
  42. package/src/clickhouse/apply/mutations.ts +9 -3
  43. package/src/clickhouse/container.ts +39 -11
  44. package/src/clickhouse/plan/cluster-drift.e2e.test.ts +117 -0
  45. package/src/clickhouse/plan/deep.ts +102 -3
  46. package/src/clickhouse/plan/normalize.ts +10 -0
  47. package/src/clickhouse/plan/plan.test.ts +10 -0
  48. package/src/clickhouse/rebuild/backfill.ts +85 -42
  49. package/src/clickhouse/rebuild/op.ts +80 -35
  50. package/src/clickhouse/rebuild/partitions.ts +11 -0
  51. package/src/clickhouse/rebuild/rebuild-sharded.e2e.test.ts +161 -0
  52. package/src/clickhouse/rebuild/rebuild.e2e.test.ts +110 -4
  53. package/src/clickhouse/rebuild/rebuild.test.ts +56 -4
  54. package/src/clickhouse/rebuild/receipts.ts +4 -6
  55. package/src/clickhouse/rebuild/shards.ts +104 -0
  56. package/src/clickhouse/rebuild/steps.ts +4 -0
  57. package/src/clickhouse/rebuild/verify.ts +14 -5
  58. package/src/config.ts +7 -0
  59. package/src/core/receipts.ts +5 -3
  60. package/src/op/activities/clickhouse-rebuild.ts +32 -7
  61. package/src/op/activities/index.ts +21 -4
  62. package/src/op/activities/sql-exec.ts +84 -0
  63. package/src/op/activity-contracts.ts +15 -0
  64. package/src/op/effect-receipts.e2e.test.ts +277 -0
  65. package/src/postgres/live/catalog.ts +3 -1
  66. package/src/postgres/migrate/migrate.test.ts +3 -2
  67. package/src/postgres/migrate/receipts.ts +18 -10
  68. package/src/receipts.test.ts +91 -0
  69. package/src/receipts.ts +259 -0
  70. package/src/skills/chant-sql-rebuild.md +5 -1
@@ -29,13 +29,19 @@ export declare class MutationFailedError extends Error {
29
29
  constructor(table: string, mutationId: string, reason: string);
30
30
  }
31
31
  /** The table's mutations that are not done. */
32
- export declare function pendingMutations(endpoint: ClickHouseEndpoint, database: string, table: string): Promise<PendingMutation[]>;
32
+ export declare function pendingMutations(endpoint: ClickHouseEndpoint, database: string, table: string, source?: string): Promise<PendingMutation[]>;
33
33
  export interface WaitOptions {
34
34
  /** How long to wait in all. Default: ten minutes. */
35
35
  timeoutMs?: number;
36
36
  /** First poll interval; it doubles up to two seconds. Default: 100ms. */
37
37
  intervalMs?: number;
38
38
  signal?: AbortSignal;
39
+ /**
40
+ * Where the mutations are listed. Default: `system.mutations`, this
41
+ * server's. A rebuild across the shards of a cluster waits on every
42
+ * server's, `clusterAllReplicas('<cluster>', system.mutations)` (#3663).
43
+ */
44
+ source?: string;
39
45
  }
40
46
  /**
41
47
  * Wait until the table has no unfinished mutation. Returns the ids waited on.
@@ -1 +1 @@
1
- {"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/apply/mutations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGnE,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,4GAA4G;AAC5G,qBAAa,oBAAqB,SAAQ,KAAK;IAE3C,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM;gBAFjB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EAAE,EACrB,SAAS,EAAE,MAAM;CAQ7B;AAED,mGAAm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AAW,EAAE,MAAM,EAAE,EACrB,SAAS,EAAE,MAAM;CAQ7B;AAED,mGAAmG;AACnG,qBAAa,mBAAoB,SAAQ,KAAK;IAE1C,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAFd,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM;CAQ1B;AAED,+CAA+C;AAC/C,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,SAAqB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAM7J;AAED,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAiB/I"}
@@ -26,8 +26,16 @@ export declare function startScratchServer(image: string, options?: {
26
26
  readyTimeoutMs?: number;
27
27
  }): Promise<ScratchServer>;
28
28
  export interface ScratchCluster {
29
- /** One endpoint per replica, in replica order (`r1`, `r2`, ...). */
29
+ /** One endpoint per server, in order: shard 1's replicas first (`r1`, `r2`, ...), then shard 2's. */
30
30
  replicas: ClickHouseEndpoint[];
31
+ /** Each server's shard and replica macros, in the order of `replicas`. */
32
+ layout: Array<{
33
+ shard: string;
34
+ replica: string;
35
+ host: string;
36
+ }>;
37
+ /** The cluster `remote_servers` defines over every server: `ON CLUSTER` and `cluster:<name>` name it. */
38
+ cluster: string;
31
39
  /** The containers' common name prefix, for a log line. */
32
40
  name: string;
33
41
  /** Remove the containers and their network. Safe to call twice. */
@@ -46,17 +54,24 @@ export interface ScratchCluster {
46
54
  startReplica(index: number): Promise<ClickHouseEndpoint>;
47
55
  }
48
56
  /**
49
- * Start `replicas` servers of `image` as one shard of replicas, on their own
50
- * Docker network, and wait until each answers and reaches Keeper.
57
+ * Start servers of `image` on their own Docker network, and wait until each
58
+ * answers and reaches Keeper: `replicas` servers as one shard of replicas,
59
+ * or, with `shards`, that many replicas in each shard (`[2, 1]` is a shard of
60
+ * two replicas and a shard of one server).
51
61
  *
52
62
  * Keeper is the server's embedded one (`keeper_server`), run by the first
53
- * replica, so the pinned server image and its digest pin Keeper too. Each
54
- * replica gets the macros `{shard}` = `s1` and `{replica}` = `r<n>`, which
55
- * a `Replicated` database's arguments name. Configuration is copied into each
56
- * container before it starts, with no bind mount.
63
+ * server, so the pinned server image and its digest pin Keeper too. Each
64
+ * server gets the macros `{shard}` = `s<n>` and `{replica}` = `r<n>` (the
65
+ * replica numbered within its shard), which a `Replicated` database's and a
66
+ * `Replicated*MergeTree`'s arguments name, and `remote_servers` defines the
67
+ * cluster `cluster` (default `chant`) over all of them, with
68
+ * `internal_replication`, so `ON CLUSTER` reaches every server. Configuration
69
+ * is copied into each container before it starts, with no bind mount.
57
70
  */
58
71
  export declare function startScratchCluster(image: string, options?: {
59
72
  replicas?: number;
73
+ shards?: number[];
74
+ cluster?: string;
60
75
  namePrefix?: string;
61
76
  readyTimeoutMs?: number;
62
77
  }): Promise<ScratchCluster>;
@@ -1 +1 @@
1
- {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/clickhouse/container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,EAAmC,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAGlF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,C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12
12
  * `deepNormalizationHooks` prunes what is not a property of the object (the
13
13
  * DDL text, the template source, lineage, a view's reads and `TO` target).
14
14
  * `chant sql plan` covers the target, and classifies every change.
15
+ *
16
+ * On a `cluster:<name>` topology every replica of every shard is read
17
+ * (#3664). When a server's copy of a table differs from the profile
18
+ * server's, that copy is what is reported, with the server in `observedOn`,
19
+ * which the drift report prints as `seen on`.
15
20
  */
16
21
  import { type DeepObservationResult, type DeepNormalizationHooks } from "@intentius/chant/deep-observation";
17
22
  import { type BindOptions } from "../live/bind.js";
@@ -1 +1 @@
1
- {"version":3,"file":"deep.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/plan/deep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAmB,KAAK,qBAAqB,EAAgC,KAAK,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3J,OAAO,EAA6C,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3F,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAG1F,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAKrC,eAAO,MAAM,yBAAyB,EAAE,sBAEvC,CAAC;AAaF,uGAAuG;AACvG,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,GAAG,KAAK,CA+BhH;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE;IACP,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CAC/E,GAAG,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,GACnC,OAAO,CAAC,qBAAqB,CAAC,CAwChC"}
1
+ {"version":3,"file":"deep.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/plan/deep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAmB,KAAK,qBAAqB,EAAgC,KAAK,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3J,OAAO,EAA6C,KAAK,WAAW,EAAyB,MAAM,cAAc,CAAC;AAMlH,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAG1F,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAKrC,eAAO,MAAM,yBAAyB,EAAE,sBAEvC,CAAC;AAaF,uGAAuG;AACvG,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,GAAG,KAAK,CA+BhH;AAqED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE;IACP,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CAC/E,GAAG,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,GACnC,OAAO,CAAC,qBAAqB,CAAC,CAgEhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/plan/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAOH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAA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gB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQlD;AAWD,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASnD;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAIvE;AA4BD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,eAAe,SAAY,GAAG,eAAe,CA2FzF"}
@@ -42,6 +42,11 @@
42
42
  * either finds nothing that replica alone has and returns, or stops the step
43
43
  * naming it (`./replicas.ts`).
44
44
  *
45
+ * On a cluster of more than one shard (#3663) the unit is a partition on one
46
+ * shard: read from that shard, written back to it, cleared on it alone, with
47
+ * its own receipt (`./shards.ts`), so a rerun after a failure on one shard
48
+ * skips what every shard already copied.
49
+ *
45
50
  * In materialized-view mode a partition is copied in two parts
46
51
  * (INTENTIUS/sql-yodeler#45). The rows before the cut-over are copied as
47
52
  * above. The rows at or after it are the view's only when they were written
@@ -60,6 +65,7 @@
60
65
  import { type ClickHouseReceiptStore } from "./receipts.js";
61
66
  import { type RebuildObservation } from "./observe.js";
62
67
  import { type RebuildRun } from "./steps.js";
68
+ import { type Shard } from "./shards.js";
63
69
  export interface BackfillResult {
64
70
  state: RebuildObservation["state"];
65
71
  /** Partitions of the old table. */
@@ -74,14 +80,14 @@ export interface BackfillResult {
74
80
  repaired: number;
75
81
  }
76
82
  /** The effect a partition's copy is, and its receipt's address suffix. */
77
- export declare const partitionEffect: (key: string, partition: string) => string;
78
- /** The receipt's expected value for one partition's copy. */
79
- export declare function partitionExpectation(o: RebuildObservation, partition: string, cutover: number | undefined): string;
83
+ export declare const partitionEffect: (key: string, partition: string, shard?: Shard) => string;
84
+ /** The receipt's expected value for one partition's copy, on one shard of a cluster when `shard` is given. */
85
+ export declare function partitionExpectation(o: RebuildObservation, partition: string, cutover: number | undefined, shard?: Shard): string;
80
86
  export interface BackfillDeps {
81
87
  /** The receipt store. Default: the receipts table on the target server. */
82
88
  receipts?: ClickHouseReceiptStore;
83
- /** Called after each partition is copied and its receipt written; a test interrupts the backfill here. */
84
- afterPartition?: (partition: string) => void | Promise<void>;
89
+ /** Called after each partition is copied and its receipt written, with its shard on a cluster of shards; a test interrupts the backfill here. */
90
+ afterPartition?: (partition: string, shard?: number) => void | Promise<void>;
85
91
  }
86
92
  export declare function backfill(run: RebuildRun, deps?: BackfillDeps): Promise<BackfillResult>;
87
93
  //# sourceMappingURL=backfill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"backfill.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/rebuild/backfill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAKH,OAAO,EAA0C,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACjG,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAIpE,OAAO,EAAkE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1G,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACnC,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,kJAAkJ;IAClJ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,0EAA0E;AAC1E,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,EAAE,WAAW,MAAM,KAAG,MAAuC,CAAC;AAEzG,6DAA6D;AAC7D,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,G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AAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAkBjI;AAED,MAAM,WAAW,YAAY;IAC3B,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,iJAAiJ;IACjJ,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9E;AAED,wBAAsB,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,GAAE,YAAiB,GAAG,OAAO,CAAC,cAAc,CAAC,CA4GhG"}
@@ -25,6 +25,12 @@
25
25
  * | Drop | the old table, once its date has passed |
26
26
  * | onFailure | drop the new table and the dual-write view |
27
27
  *
28
+ * `gates: "outer"` (#3658) leaves out both approval gates and the Drop phase,
29
+ * for a caller that runs the Op under an approval of its own: the run goes
30
+ * from Plan to Retain, verification and the swap's own comparison included.
31
+ * `onFailure: "keep"` leaves out the onFailure, so a failed run's next run
32
+ * resumes the backfill from its receipts instead of starting again.
33
+ *
28
34
  * Run it until it is done: each run goes as far as the next gate. Every step
29
35
  * re-reads the server, so a run after a gate, a crash or an approval picks up
30
36
  * where the last stopped. A run killed during the backfill (Ctrl-C, a lost
@@ -52,6 +58,27 @@ export interface ClickHouseRebuildOpConfig {
52
58
  build?: boolean;
53
59
  /** How long the old table is kept after the swap, as a duration (`7d`, `36h`). Default: `7d`. */
54
60
  retain?: string;
61
+ /**
62
+ * Whose approval the swap and the drop wait for. `"own"` (the default): the
63
+ * Op's two gates. `"outer"`: an approval the caller already holds for a
64
+ * larger change that runs this Op as one of its steps. The swap gate, the
65
+ * drop gate and the Drop phase are left out, so the Op ends at Retain with
66
+ * the old table kept as `<table>__chant_old` with its retention date. Drop
67
+ * it after that date, or run the Op with `"own"`: its swap gate has
68
+ * nothing left to swap, and its drop gate binds that old table.
69
+ * The verification still runs, and the swap compares the tables again
70
+ * before the `EXCHANGE`: any difference fails the run with nothing swapped.
71
+ * App mode's writes-stopped gate is not an approval and stays.
72
+ */
73
+ gates?: "own" | "outer";
74
+ /**
75
+ * What a failed run does with the new table and the dual-write view.
76
+ * `"drop"` (the default): onFailure drops them, and the next run starts
77
+ * again from a new table. `"keep"`: there is no onFailure, and the next run
78
+ * resumes the backfill from its per-partition receipts. To start again
79
+ * instead, drop `<table>__chant_new` and `<table>__chant_dual`.
80
+ */
81
+ onFailure?: "drop" | "keep";
55
82
  /** The gate before the swap. Default name `approve-<name>`. */
56
83
  gate?: {
57
84
  gate?: string;
@@ -103,6 +130,8 @@ export interface ClickHouseRebuildArgs {
103
130
  stack?: string;
104
131
  ownershipEnv?: string;
105
132
  cwd?: string;
133
+ /** A failed run keeps the new table (`onFailure: "keep"`): a refusal says to drop it by hand. */
134
+ keepOnFailure?: boolean;
106
135
  }
107
136
  export declare function ClickHouseRebuildOp(config: ClickHouseRebuildOpConfig): ClickHouseRebuildOpResources;
108
137
  //# sourceMappingURL=op.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"op.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/rebuild/op.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAyC,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,WAAW,yBAAyB;IACxC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,GAAG,EAAE,MAAM,CAAC;IACZ,yFAAyF;IACzF,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,SAAS,EAAE,SAAS,CAAC;IACrB,kFAAkF;IAClF,MAAM,CAAC,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MAAM,EAAE,yBAAyB,GAAG,4BAA4B,CAqHnG"}
@@ -12,8 +12,16 @@
12
12
  */
13
13
  import type { ClickHouseTarget } from "../live/bind.js";
14
14
  import type { CopiedColumn, RebuildNames } from "./observe.js";
15
+ import type { Sharding } from "./shards.js";
15
16
  /** The old table's active partitions, by id. */
16
17
  export declare function sourcePartitions(target: ClickHouseTarget, names: RebuildNames): Promise<string[]>;
18
+ /** The old table's active partitions on each shard of a cluster (#3663), through this server. */
19
+ export declare function shardPartitions(run: {
20
+ target: ClickHouseTarget;
21
+ }, sharding: Sharding, database: string, table: string): Promise<Array<{
22
+ shard: number;
23
+ partition: string;
24
+ }>>;
17
25
  /** Rename the columns an expression names, old name to new, leaving function names and qualified names alone. */
18
26
  export declare function renameColumns(expr: string, copied: readonly CopiedColumn[]): string;
19
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"partitions.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/rebuild/partitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE5D,gDAAgD;AAChD,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAOvG;AAED,iHAAiH;AACjH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,CAQnF;AAeD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,CAKjH"}
1
+ {"version":3,"file":"partitions.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/rebuild/partitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,gDAAgD;AAChD,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAOvG;AAED,iGAAiG;AACjG,wBAAsB,eAAe,CAAC,GAAG,EAAE;IAAE,MAAM,EAAE,gBAAgB,CAAA;CAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAOlL;AAED,iHAAiH;AACjH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,CAQnF;AAeD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,CAKjH"}
@@ -21,12 +21,10 @@
21
21
  *
22
22
  * The store implements core's `ReceiptStore` seam
23
23
  * (`@intentius/chant/op/receipt-store`), as the sql lexicon's shared
24
- * `SqlReceiptStore` (`../../core/receipts.ts`). It is not exported as the
25
- * `receiptRead` / `receiptWrite` activities: those names are global to a
26
- * run, and a project that also configures aws or k8s would have its
27
- * `effect()` steps read ClickHouse instead of SSM or a ConfigMap. The backfill
28
- * activity reaches the store directly, the way the fly lexicon's release
29
- * component reaches its own.
24
+ * `SqlReceiptStore` (`../../core/receipts.ts`). The backfill activity
25
+ * reaches the store directly, the way the fly lexicon's release component
26
+ * reaches its own. The same table holds the receipts of a sql project's
27
+ * `effect()` steps (`../../receipts.ts`), under their own addresses.
30
28
  *
31
29
  * Write discipline: the backfill writes a partition's receipt after the
32
30
  * partition's copy succeeded, last, and nothing else writes one.
@@ -1 +1 @@
1
- {"version":3,"file":"receipts.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/rebuild/receipts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAIH,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAInE,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvD,wGAAwG;AACxG,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAClD,4CAA4C;AAC5C,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC,wFAAwF;AACxF,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAE5D,oHAAoH;AACpH,wBAAgB,aAAa,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAEvF;AAMD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,oEAAoE;AACpE,MAAM,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAErD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,kBAAkB,EAC5B,QAAQ,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAC1C,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAO,GACnG,sBAAsB,CA8DxB"}
1
+ {"version":3,"file":"receipts.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/rebuild/receipts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAIH,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAInE,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvD,wGAAwG;AACxG,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAClD,4CAA4C;AAC5C,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC,wFAAwF;AACxF,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAE5D,oHAAoH;AACpH,wBAAgB,aAAa,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAEvF;AAMD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,oEAAoE;AACpE,MAAM,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAErD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,kBAAkB,EAC5B,QAAQ,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAC1C,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAO,GACnG,sBAAsB,CA8DxB"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * A rebuild across the shards of a cluster (#3663).
3
+ *
4
+ * On a `cluster:<name>` topology the rebuild's DDL runs `ON CLUSTER`, so
5
+ * every server gets the new table, the dual-write view and the swap. The
6
+ * rows do not move that way: each shard holds its own, and a copy run on
7
+ * the profile's server alone copies that server's shard and no other. So
8
+ * with more than one shard, the backfill and the verification work shard by
9
+ * shard, all through the profile's server:
10
+ *
11
+ * - a shard's rows are read with `cluster('<name>', db, t)` and
12
+ * `_shard_num = <n>`, one replica per shard, as the cluster's own
13
+ * configuration reaches it;
14
+ * - they are written back to the same shard with
15
+ * `INSERT INTO FUNCTION cluster('<name>', db, t__chant_new, <slot>)`, a
16
+ * constant sharding key that lands on that shard, inserted in the
17
+ * foreground so the statement returns once the shard has the rows;
18
+ * - a shard's half-copied rows are deleted with an `ALTER ... ON CLUSTER`
19
+ * whose condition holds on that shard's servers only
20
+ * (`getMacro('shard')`, the macro the cluster's Keeper paths already use).
21
+ *
22
+ * Each (shard, partition) is one copy with its own receipt, so a rerun after
23
+ * a failure on one shard skips what every shard already copied.
24
+ *
25
+ * With one shard nothing changes: the replicas of a shard replicate what is
26
+ * written on any of them, which is what the rebuild has always relied on.
27
+ */
28
+ import type { ClickHouseTarget } from "../live/bind.js";
29
+ export interface Shard {
30
+ /** `_shard_num` / `system.clusters.shard_num`, from 1. */
31
+ num: number;
32
+ /** The shard's `{shard}` macro, the same on each of its replicas. */
33
+ macro: string;
34
+ /** The sharding key that lands on this shard: the sum of the weights of the shards before it. */
35
+ slot: number;
36
+ }
37
+ export interface Sharding {
38
+ cluster: string;
39
+ shards: Shard[];
40
+ }
41
+ /** Settings for a copy into one shard: in the foreground, and read from the cluster rather than pushed down to each shard. */
42
+ export declare const SHARD_INSERT_SETTINGS: Record<string, string>;
43
+ /** Settings for a delete on one shard: its condition is the server's own macro, the same on every replica of the shard. */
44
+ export declare const SHARD_DELETE_SETTINGS: Record<string, string>;
45
+ /**
46
+ * The shards of the target's cluster, when its topology is `cluster:<name>`
47
+ * and the cluster has more than one. Undefined otherwise: the rebuild works
48
+ * on the profile's server as it always has.
49
+ */
50
+ export declare function clusterSharding(target: ClickHouseTarget): Promise<Sharding | undefined>;
51
+ /** One shard's rows of `database.table`, as a table expression; filter with {@link onShard}. */
52
+ export declare const shardTable: (sharding: Sharding, database: string, table: string) => string;
53
+ /** The condition that keeps one shard's rows of a {@link shardTable}. */
54
+ export declare const onShard: (shard: Shard) => string;
55
+ /** Where a copy into one shard of `database.table` writes. */
56
+ export declare const intoShard: (sharding: Sharding, shard: Shard, database: string, table: string) => string;
57
+ /** The condition, in an `ALTER ... ON CLUSTER` mutation, that holds on that shard's servers only. */
58
+ export declare const onShardServers: (shard: Shard) => string;
59
+ //# sourceMappingURL=shards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shards.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/rebuild/shards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIrD,MAAM,WAAW,KAAK;IACpB,0DAA0D;IAC1D,GAAG,EAAE,MAAM,CAAC;IACZ,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,iGAAiG;IACjG,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED,8HAA8H;AAC9H,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAmF,CAAC;AAE7I,2HAA2H;AAC3H,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAkE,CAAC;AAE5H;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAgC7F;AAED,gGAAgG;AAChG,eAAO,MAAM,UAAU,GAAI,UAAU,QAAQ,EAAE,UAAU,MAAM,EAAE,OAAO,MAAM,KAAG,MAAwF,CAAC;AAE1K,yEAAyE;AACzE,eAAO,MAAM,OAAO,GAAI,OAAO,KAAK,KAAG,MAAqC,CAAC;AAE7E,8DAA8D;AAC9D,eAAO,MAAM,SAAS,GAAI,UAAU,QAAQ,EAAE,OAAO,KAAK,EAAE,UAAU,MAAM,EAAE,OAAO,MAAM,KAAG,MACU,CAAC;AAEzG,qGAAqG;AACrG,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,KAAG,MAAyD,CAAC"}
@@ -9,6 +9,7 @@
9
9
  import type { OwnershipMarker } from "@intentius/chant/ownership";
10
10
  import type { ClickHouseTarget } from "../live/bind.js";
11
11
  import { type DeclaredObject } from "../apply/statements.js";
12
+ import type { Sharding } from "./shards.js";
12
13
  import { type DualWrite, type RebuildObservation } from "./observe.js";
13
14
  /** What every step is given. */
14
15
  export interface RebuildRun {
@@ -28,6 +29,8 @@ export interface RebuildRun {
28
29
  signal?: AbortSignal;
29
30
  /** The run's id, recorded on the receipts it writes. */
30
31
  runId?: string;
32
+ /** On a cluster of more than one shard, its shards: the backfill and the verification work shard by shard (`./shards.ts`). */
33
+ sharding?: Sharding;
31
34
  }
32
35
  /** The server's clock, in milliseconds: the cut-over and the retention are the server's times, not this machine's. */
33
36
  export declare function serverNow(target: ClickHouseTarget): Promise<number>;
@@ -1 +1 @@
1
- {"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/rebuild/steps.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAyE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKjI,OAAO,EAML,KAAK,SAAS,EACd,KAAK,kBAAkB,EACxB,MAAM,WAAW,CAAC;AAEnB,gCAAgC;AACh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C,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAOtI;AASD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACnC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,GAAG,EAAE,OAAO,CAAC;IACb,oHAAoH;IACpH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,sFAAsF;AACtF,wBAAsB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAavE;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,2GAA2G;AAC3G,wBAAsB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAUvE;AAID,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAoBtI"}
@@ -24,6 +24,10 @@
24
24
  * later than the cut-over delay, with a time before the cut-over) stop the
25
25
  * swap too, rather than stay behind in the old table.
26
26
  *
27
+ * On a cluster of more than one shard (#3663) every shard is read, through
28
+ * the profile's server, and each partition is compared per shard
29
+ * (`shard<n>/<partition>`), so a shard the copy missed is a difference.
30
+ *
27
31
  * Any difference fails the run, naming the partitions; the run's onFailure
28
32
  * then drops the new table. On a match the result carries the digest the
29
33
  * swap gate binds: the rebuild's plan and the counts and checksums of the
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/rebuild/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKH,OAAO,EAAsC,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAExF,OAAO,EAAuD,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAE/F,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACnC,4IAA4I;IAC5I,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,qGAAqG;IACrG,YAAY,EAAE,cAAc,EAAE,CAAC;CAChC;AAED,sDAAsD;AACtD,qBAAa,wBAAyB,SAAQ,KAAK;IAE/C,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB,QAAQ,CAAC,UAAU,EAAE,QAAQ,EAAE;gBADtB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,QAAQ,EAAE;CAalC;AAyED,MAAM,MAAM,QAAQ,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,cAAc,CAAC;IAAC,GAAG,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC;AAYzF,kGAAkG;AAClG,eAAO,MAAM,OAAO,GAAI,SAAS,SAAS,MAAM,EAAE,KAAG,MAA8D,CAAC;AAEpH;;;GAGG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,CAAC,EAA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,KAAG,MAA8D,CAAC;AAEpH;;;GAGG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1F;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CA2B1E"}
package/dist/config.d.ts CHANGED
@@ -97,6 +97,13 @@ export declare const sqlProfileSchema: z.ZodObject<{
97
97
  schemas: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
98
  /** Postgres: the schema an unqualified declaration is created in. `public` when omitted. */
99
99
  defaultSchema: z.ZodOptional<z.ZodString>;
100
+ /**
101
+ * Postgres: the schema `effect()` receipts are kept in, as
102
+ * `<schema>.__chant_receipts`. When omitted they are in
103
+ * `chant_receipts.receipts`, a schema chant creates; name an existing schema
104
+ * on a server where the role cannot `CREATE SCHEMA`.
105
+ */
106
+ receiptsSchema: z.ZodOptional<z.ZodString>;
100
107
  /**
101
108
  * The managed service this environment's Postgres runs on, when it differs
102
109
  * from `sql.provider`. Import reads the provider's own roles, schemas and
@@ -214,6 +221,13 @@ export declare const sqlConfigSchema: z.ZodObject<{
214
221
  schemas: z.ZodOptional<z.ZodArray<z.ZodString>>;
215
222
  /** Postgres: the schema an unqualified declaration is created in. `public` when omitted. */
216
223
  defaultSchema: z.ZodOptional<z.ZodString>;
224
+ /**
225
+ * Postgres: the schema `effect()` receipts are kept in, as
226
+ * `<schema>.__chant_receipts`. When omitted they are in
227
+ * `chant_receipts.receipts`, a schema chant creates; name an existing schema
228
+ * on a server where the role cannot `CREATE SCHEMA`.
229
+ */
230
+ receiptsSchema: z.ZodOptional<z.ZodString>;
217
231
  /**
218
232
  * The managed service this environment's Postgres runs on, when it differs
219
233
  * from `sql.provider`. Import reads the provider's own roles, schemas and
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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ps
12
12
  * the receipts in a table whose comment carries the ownership trailer with
13
- * the `receipts` key (`./ownership.ts`), so schema reads leave it out. It is
14
- * not registered as the global `receiptRead` / `receiptWrite` activities,
15
- * which would take over every other lexicon's `effect()` steps in the run.
13
+ * the `receipts` key (`./ownership.ts`), so schema reads leave it out. A
14
+ * migration's store is reached by its backfill directly. The store `effect()`
15
+ * steps use (`../receipts.ts`) is registered as the `receiptRead` /
16
+ * `receiptWrite` activities only as a fallback, so it never takes over
17
+ * another configured lexicon's receipt row.
16
18
  */
17
19
  import type { ReceiptStore } from "@intentius/chant/op/receipt-store";
18
20
  /** The receipt's address: `<stack>/<env>/<effect>`, the same fields an ownership marker carries. */
@@ -1 +1 @@
1
- {"version":3,"file":"receipts.d.ts","sourceRoot":"","sources":["../../src/core/receipts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEtE,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,QAAQ,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEjG;AAED,4CAA4C;AAC5C,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,2GAA2G;IAC3G,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACvD"}
1
+ {"version":3,"file":"receipts.d.ts","sourceRoot":"","sources":["../../src/core/receipts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEtE,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,QAAQ,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEjG;AAED,4CAA4C;AAC5C,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,2GAA2G;IAC3G,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACvD"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "82beced7beffe2bdd0dcf24728910539758d9d4dc85c94fe6418167bcbea9636",
4
+ "manifest.json": "79c196cbd4ca36957499a27ffc13ed2dd61684f5758721bca0ca31b1270bbc7f",
5
5
  "meta.json": "5b7a5d171aa8bd21c0d55cfbe421143d67da02b7ef924a9b66166790c3fc7b22",
6
6
  "types/index.d.ts": "0286ebb367773e84c76818b0f69cb14cff8328fd2f8c65ed87563c8d5815458c",
7
7
  "rules/postgres-templates.ts": "f7244417426c441180ccb5c52da32cd812960d6d4eaba1fbdb17f47fcae707b2",
@@ -57,5 +57,5 @@
57
57
  "rules/sqlpg117.ts": "3d5c2d57ccdee3cf91c3ba3cb6363750787a850df8ebd75e9cc3f33113303827",
58
58
  "rules/sqlpg118.ts": "e2a40a88a9374c4d99d02118ca4c60877ba0c6eb1ce603a93b24f5fd23d81dde"
59
59
  },
60
- "composite": "619bc77b9a85523857c04bc2fd6ab9a538a97bca5c6824aadf06c3b58a517b76"
60
+ "composite": "5602bd7d7bb9c32cdb1ad2225fbe2a360bb7095ff0036fce48636cde1809c1b9"
61
61
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sql",
3
- "version": "0.114.1",
3
+ "version": "0.115.0",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "SQL",
6
6
  "intrinsics": [],
@@ -1 +1 @@
1
- {"version":3,"file":"clickhouse-rebuild.d.ts","sourceRoot":"","sources":["../../../src/op/activities/clickhouse-rebuild.ts"],"names":[],"mappings":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,IAAI,GAAE,qBAA0B,GAAG,OAAO,CAAC,UAAU,CAAC,CAEpJ;AAED,6DAA6D;AAC7D,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,qBAAqB,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,IAAI,GAAE,qBAA0B,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAEhK"}
@@ -4,14 +4,26 @@
4
4
  * applier (`clickhouseApply`, #3208), the Postgres applier (`postgresApply`,
5
5
  * #3280) and their envelope projection (`toApplyResult`, one for both), which
6
6
  * core's apply activity looks up by name for the `clickhouse` and `postgres`
7
- * targets, the emulator lifecycles, and the steps of the two migration Ops.
7
+ * targets, the emulator lifecycles, the steps of the two migration Ops, and
8
+ * the receipt store and SQL step of an Op of `effect()` batches.
8
9
  */
10
+ import type { ReceiptReadArgs, ReceiptStalenessArgs, ReceiptWriteArgs } from "@intentius/chant/op/receipt-store";
9
11
  export { clickhouseApply, toApplyResult, resolveMarker } from "./clickhouse-apply.js";
10
12
  export type { ClickHouseApplyArgs, ClickHouseApplyDeps, ClickHouseApplyOutcome } from "./clickhouse-apply.js";
11
13
  export { clickhouseUp, clickhouseDown, CLICKHOUSE_EMULATOR, CLICKHOUSE_EMULATOR_SPEC } from "./clickhouse-emulator.js";
12
14
  export { postgresApply } from "./postgres-apply.js";
13
15
  export type { PostgresApplyArgs, PostgresApplyDeps, PostgresApplyOutcome } from "./postgres-apply.js";
14
16
  export { postgresUp, postgresDown, POSTGRES_EMULATOR, POSTGRES_EMULATOR_SPEC } from "./postgres-emulator.js";
17
+ /** The activities this module provides only when no other configured lexicon does. */
18
+ export declare const ACTIVITY_FALLBACKS: readonly string[];
19
+ export declare const receiptRead: (args: ReceiptReadArgs, signal?: AbortSignal) => Promise<import("@intentius/chant/op").ReceiptReadResult>;
20
+ export declare const receiptWrite: (args: ReceiptWriteArgs, signal?: AbortSignal) => Promise<{
21
+ written: true;
22
+ receipt: string;
23
+ }>;
24
+ export declare const receiptStaleness: (args: ReceiptStalenessArgs, signal?: AbortSignal) => Promise<import("@intentius/chant/op").ReceiptStalenessResult>;
25
+ export { sqlExec } from "./sql-exec.js";
26
+ export type { SqlExecArgs, SqlExecResult, SqlExecDeps } from "./sql-exec.js";
15
27
  export { clickhouseRebuildPlan, clickhouseRebuildCreate, clickhouseRebuildDualWrite, clickhouseRebuildBackfill, clickhouseRebuildVerify, clickhouseRebuildSwap, clickhouseRebuildRetain, clickhouseRebuildDrop, clickhouseRebuildCompensate, } from "./clickhouse-rebuild.js";
16
28
  export type { ClickHouseRebuildArgs, ClickHouseRebuildDeps, RebuildPlanResult } from "./clickhouse-rebuild.js";
17
29
  export { postgresMigrationPlan, postgresMigrationExpand, postgresMigrationDualWrite, postgresMigrationBackfill, postgresMigrationCarry, postgresMigrationVerify, postgresMigrationSwitch, postgresMigrationRetain, postgresMigrationContract, postgresMigrationCompensate, } from "./postgres-migration.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnF,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC3G,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACpH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAO1G,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EACvB,qBA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AAC7H,eAAO,MAAM,YAAY,GAAI,MAAM,gBAAgB,EAAE,SAAS,WAAW;;;EAAsD,CAAC;AAChI,eAAO,MAAM,gBAAgB,GAAI,MAAM,oBAAoB,EAAE,SAAS,WAAW,kEAA0D,CAAC;AAC5I,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAK1E,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAM5G,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * `sqlExec` (#3657): run SQL on the environment's database server, the step
3
+ * an `effect()` batch of a sql project is made of.
4
+ *
5
+ * effect(EffectReceipt("country-202601", { effect: "country/202601", flavor: "existence" }), [
6
+ * activity("sqlExec", { sql: "ALTER TABLE shop.orders UPDATE country = 'NL' WHERE toYYYYMM(ts) = 202601" }, "atMostOnce"),
7
+ * ])
8
+ *
9
+ * The server is the one `effect()`'s receipts are kept on
10
+ * (`../../receipts.ts`): `sql.profiles.<env>` for the environment
11
+ * `chant run --env` sets, else `CLICKHOUSE_URL` or `POSTGRES_URL`. `environment`
12
+ * in the arguments names another. On Postgres the SQL runs on a connection of
13
+ * its own with the role's default `search_path`, as one implicit transaction;
14
+ * on ClickHouse, `settings` are sent with the query.
15
+ */
16
+ import type { ChantConfig } from "@intentius/chant/config";
17
+ export interface SqlExecArgs {
18
+ /** The SQL to run: one statement on ClickHouse; one or more on Postgres. */
19
+ sql: string;
20
+ /** The chant environment whose server it runs on. Default: `CHANT_ENV`, then a literal `ownership.env`. */
21
+ environment?: string;
22
+ /** ClickHouse: query settings (`mutations_sync`, `max_execution_time`). */
23
+ settings?: Record<string, string | number>;
24
+ /** The project directory chant.config.ts is read from. Default: the working directory. */
25
+ cwd?: string;
26
+ }
27
+ export interface SqlExecResult {
28
+ dialect: "clickhouse" | "postgres";
29
+ /** Where the server binding came from: `sql.profiles.prod` or `env CLICKHOUSE_URL`. */
30
+ source: string;
31
+ /** Rows the statement returned (a `SELECT`); 0 for one that returns none. */
32
+ rows: number;
33
+ }
34
+ /** What a test may inject instead of the project's config and the process env. */
35
+ export interface SqlExecDeps {
36
+ config?: Pick<ChantConfig, "sql" | "ownership">;
37
+ env?: Record<string, string | undefined>;
38
+ log?: (line: string) => void;
39
+ }
40
+ export declare function sqlExec(args: SqlExecArgs, signal?: AbortSignal, deps?: SqlExecDeps): Promise<SqlExecResult>;
41
+ //# sourceMappingURL=sql-exec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-exec.d.ts","sourceRoot":"","sources":["../../../src/op/activities/sql-exec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAO3D,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,GAAG,EAAE,MAAM,CAAC;IACZ,2GAA2G;IAC3G,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC3C,0FAA0F;IAC1F,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,YAAY,GAAG,UAAU,CAAC;IACnC,uFAAuF;IACvF,MAAM,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kFAAkF;AAClF,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,WAAW,CAAC,CAAC;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAWD,wBAAsB,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,WAAW,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,CAyBrH"}