Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions apps/cli/src/server/local-schema-history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,19 @@ export const LOCAL_SCHEMA_HISTORY: ReadonlyArray<LocalSchemaHistoryEntry> = Obje
manifestDigest: "2f52ca5a525a85621729e885a028bc9bfe73fa94ef62be7790efec0283d792d5",
projectRevision: "ed74788ef292834069e0ea6ee3b22d68fc604fb66cb54d2d551db67ce8d20b3a",
}),
Object.freeze({
// v28 appends SpanKind and IsRoot to service_overview_spans and recreates
// its view to fill them. Nothing is backfilled: older rows read '' / 0.
//
// projectRevision is carried forward deliberately: it is a hardcoded
// constant that no longer tracks the generator's header, and the identity
// this gate compares is the fingerprint/digest pair.
version: 28,
fingerprint: "8a24f256937e00e5",
digest: "8a24f256937e00e51147034fef1567a9662b982799e85af4030c4f7e9739097d",
manifestDigest: "c4958036747018eb07b2657c05b18e37c4f29d5eb4c1d433e5f055ebb234ed18",
projectRevision: "ed74788ef292834069e0ea6ee3b22d68fc604fb66cb54d2d551db67ce8d20b3a",
}),
] as const)

/** Immutable SQLite control DDL identities, checked by clickhouse:schema:check. */
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/server/local-schema-version.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Increment this value for every structural change to the generated local
// schema. The compatibility manifest and migration registry must be updated in
// the same change before a new value can ship.
export const LOCAL_SCHEMA_VERSION = 27 as const
export const LOCAL_SCHEMA_VERSION = 28 as const

/** SQLite eventing state has its own independent version sequence. */
export const LOCAL_CONTROL_SCHEMA_VERSION = 1 as const
35 changes: 35 additions & 0 deletions apps/cli/src/server/local-store-migrations/steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1159,5 +1159,40 @@ export const LOCAL_STORE_STEPS: ReadonlyArray<StepSpec> = [
},
],
},
{
id: "local-0027-to-0028-service-overview-spans-span-kind",
from: 27,
to: 28,
description:
"Add SpanKind and IsRoot to service_overview_spans and recreate service_overview_spans_mv to fill them",
clonedBefore: "any DDL runs",
beforeBootstrap: [
addColumns("service_overview_spans", [
["SpanKind", "LowCardinality(String) DEFAULT ''"],
["IsRoot", "UInt8 DEFAULT 0"],
]),
dropViews("service_overview_spans_mv"),
],
plan: [
[
"widen-service-overview-spans",
"Add SpanKind and IsRoot to service_overview_spans and rebuild service_overview_spans_mv to fill them",
],
],
verifies: "Verify the v28 physical schema and the retained raw telemetry counts",
dispositions: [
TRACES_UNDER_REPLACED_VIEWS,
{
name: "service_overview_spans",
classification: "derived",
disposition: "rebuild-within-retention-horizon",
guarantee:
"Existing rows are preserved untouched with an empty SpanKind and a zero IsRoot; the rebuilt view fills both for spans materialized after the migration and the gap closes as the 30-day retention window rolls.",
preservationInterval: "source retention horizon",
sourceRetentionDays: 30,
targetRetentionDays: 30,
},
],
},
// local-schema:bump appends the next step above this line.
]
3 changes: 3 additions & 0 deletions apps/cli/src/server/schema-identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import schemaV24Sql from "./schema/local-schema-v24.sql" with { type: "text" }
import schemaV25Sql from "./schema/local-schema-v25.sql" with { type: "text" }
import schemaV26Sql from "./schema/local-schema-v26.sql" with { type: "text" }
import schemaV27Sql from "./schema/local-schema-v27.sql" with { type: "text" }
import schemaV28Sql from "./schema/local-schema-v28.sql" with { type: "text" }
import { schemaDigest as digestSchema, schemaFingerprint as fingerprintSchema } from "./store-version"
import { buildLocalSchemaManifest, type LocalSchemaManifest } from "./schema-manifest"
import { LOCAL_SCHEMA_VERSION } from "./local-schema-version"
Expand Down Expand Up @@ -97,6 +98,7 @@ const SNAPSHOT_SQL: ReadonlyArray<string> = [
schemaV25Sql,
schemaV26Sql,
schemaV27Sql,
schemaV28Sql,
]

export interface LocalSchemaSnapshot {
Expand Down Expand Up @@ -181,6 +183,7 @@ export const LOCAL_SCHEMA_V24 = localSchemaIdentity(24)
export const LOCAL_SCHEMA_V25 = localSchemaIdentity(25)
export const LOCAL_SCHEMA_V26 = localSchemaIdentity(26)
export const LOCAL_SCHEMA_V27 = localSchemaIdentity(27)
export const LOCAL_SCHEMA_V28 = localSchemaIdentity(28)

export const CURRENT_LOCAL_SCHEMA: LocalSchemaIdentity = Object.freeze({
version: LOCAL_SCHEMA_VERSION,
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/src/server/schema/local-inserts.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"projectRevision": "4305027b76678ea156f64ad487cad6557295c8e138c7fc4fb0e076d81c5e5247",
"projectRevision": "6c40bbce25f0440e6c3d83eb54307565485620b46787fc993b312a1e1ed75f8a",
"orgPlaceholder": "__ORG__",
"datasources": {
"traces": {
Expand Down
Loading
Loading