Skip to content

Commit 4ec499d

Browse files
fix(mst2): timestamp retained roots during native batch acquisition
Fix the two native batch root inserts to supply PostgreSQL now() for the existing required created_at column. Preserve graph locks, identities, ON CONFLICT semantics and all HTTP/generation assertions. Keep the reproducible bootstrap fixture consistent with the validated default import directory. Native run 37615218353 exposed 29 missing-timestamp failures and three invalid-fixture failures; source review, nightly formatting and locked offline metadata passed, native retest pending.
1 parent 7aa99f0 commit 4ec499d

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/commands/service/init_commit_time_tests.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async fn fixture() -> Fixture {
113113
let (database, schema) = test_db_config(directory.path()).await;
114114
let mut config = isolated_config(directory.path().join("config"));
115115
config.database = database;
116-
config.monorepo.root_dirs = vec!["bench".to_string()];
116+
config.monorepo.root_dirs = vec!["bench".to_string(), "third-party".to_string()];
117117
config.redis.url = "redis://127.0.0.1:1".to_string();
118118
let args = cli()
119119
.try_get_matches_from(["init", "--yes", "--commit-time", "1790000000"])

‎src/jupiter/storage/mst2_retention.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ impl PostgresRetentionRepository {
167167
return Err(integrity("retention root is bound to another DAG or kind"));
168168
}
169169
savepoint.execute_raw(statement(
170-
"INSERT INTO mst2_retention_root(node_id,root_key,root_kind)
171-
SELECT $1,p.key,p.kind FROM jsonb_to_recordset($2::jsonb) AS p(key text,kind text)
170+
"INSERT INTO mst2_retention_root(node_id,root_key,root_kind,created_at)
171+
SELECT $1,p.key,p.kind,now() FROM jsonb_to_recordset($2::jsonb) AS p(key text,kind text)
172172
ON CONFLICT(node_id,root_key) DO NOTHING",[node_id.into(),encoded.into()],
173173
)).await.map_err(internal)?;
174174
Ok(())

‎src/jupiter/storage/native_metadata_generations.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ impl PostgresMetadataGenerationRepository {
219219
// Reuse only already LIVE graph rows. RESERVED pages without a graph
220220
// are protected by the durable mappings, without inventing a DAG.
221221
txn.execute_raw(statement(
222-
"INSERT INTO mst2_retention_root(node_id,root_key,root_kind)
223-
SELECT l.node_id,'prepare:'||p.prepare_id,'prepare'
222+
"INSERT INTO mst2_retention_root(node_id,root_key,root_kind,created_at)
223+
SELECT l.node_id,'prepare:'||p.prepare_id,'prepare',now()
224224
FROM mst2_metadata_prepare_page p JOIN mst2_metadata_lifetime l
225225
ON l.page_id=p.page_id AND l.generation=p.generation
226226
JOIN mst2_retention_node n ON n.node_id=l.node_id AND n.state='LIVE'

0 commit comments

Comments
 (0)