fix: backfill schemaDefined on replicas missing the flag#503
Conversation
|
Reviewed; no blockers found. |
cb1kenobi
left a comment
There was a problem hiding this comment.
I don't know much about this, but makes sense. It would be nice if it was easy to add a test that demonstrates this fixes things.
|
What is the situation where this can occur? I thought line 907 in databases.ts consistently set this flag. |
When the on-disk primary-attribute descriptor in attributesDbi lacks schemaDefined (the state replica nodes were left in by 4.7.x deploys with replicated=true), re-entering table() must: - heal Table.schemaDefined in memory, and - rewrite the descriptor with schemaDefined: true on disk. The test strips the flag from a freshly created descriptor, drops the in-memory state via resetDatabases (mimicking a process restart on a replica), re-calls table(), and asserts both the in-memory class and the persisted descriptor have schemaDefined: true. Addresses the PR #503 review request to exercise the needsSchemaDefinedBackfill branch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@kriszyp I think that line just sets the local variable... from what I can tell it only gets persisted via the new table branch, and the existing table branch doesn't seem to rewrite the descriptor, so once a replica ends up on disk without the flag the defaulting probably can't reach back. My guess is that's what 4.7.x replicated=true deploys were producing |
When the on-disk primary-attribute descriptor in attributesDbi lacks schemaDefined (the state replica nodes were left in by 4.7.x deploys with replicated=true), re-entering table() must: - heal Table.schemaDefined in memory, and - rewrite the descriptor with schemaDefined: true on disk. The test strips the flag from a freshly created descriptor, drops the in-memory state via resetDatabases (mimicking a process restart on a replica), re-calls table(), and asserts both the in-memory class and the persisted descriptor have schemaDefined: true. Addresses the PR #503 review request to exercise the needsSchemaDefinedBackfill branch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1f2f850 to
196b585
Compare
…replicated-tables-rebase # Conflicts: # resources/databases.ts # unitTests/resources/databases.test.js
Mirrors the fix Kris applied to northwind.test.mjs (48179a1). On Bun shard 2, embed-directive tear-down (HNSW flush) starves the job processor, so csv_data_load sits IN_PROGRESS past the default 30s. Same suite, same shard, same fix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
No description provided.