CI / UI Checks (pull_request) Successful in 8s
CI / Rust Checks (pull_request) Successful in 21m42s
CI / Rust Feature Validation (pull_request) Skipped
CI / Frontend E2E (pull_request) Skipped
CI / Community Image Smoke (pull_request) Skipped
CI / Required Checks (pull_request) Successful in 1s
CI / Deploy (pull_request) Skipped
Durable worker приостанавливает Task как input_required до dispatch, если закреплённая схема требует отсутствующее поле; authorized schema-validated update атомарно и с аудитом возобновляет тот же Task ровно один раз. Replay/conflict/TTL безопасны, ожидание удерживает admission permit. Additive schema v30: task_input_requests, fingerprint/version, TTL-индекс.
46 lines
1.3 KiB
Rust
46 lines
1.3 KiB
Rust
use sqlx::{Postgres, Transaction, query};
|
|
|
|
use super::authority::{MigrationDescriptor, MigrationError};
|
|
|
|
pub(super) const NAME: &str = "durable-task-input-v30";
|
|
pub(super) const SOURCE: &str = include_str!("durable_task_input_v30.sql");
|
|
pub(super) const SOURCE_SHA256: &str =
|
|
"84a51f712fd0bc439acba2ab3849232777c29e3b181586bbb4b06fd129843a38";
|
|
|
|
pub(super) async fn apply(
|
|
transaction: &mut Transaction<'_, Postgres>,
|
|
descriptor: &MigrationDescriptor,
|
|
) -> Result<(), MigrationError> {
|
|
sqlx::raw_sql(SOURCE)
|
|
.execute(&mut **transaction)
|
|
.await
|
|
.map_err(|_| {
|
|
MigrationError::new(
|
|
"apply_failed",
|
|
"apply.durable_task_input_v30",
|
|
Some(30),
|
|
"restore_known_good_backup",
|
|
)
|
|
})?;
|
|
query(
|
|
"insert into __crank_migrations (version, name, checksum, phase, compatibility)
|
|
values ($1, $2, $3, $4, $5)",
|
|
)
|
|
.bind(descriptor.version)
|
|
.bind(descriptor.name)
|
|
.bind(&descriptor.checksum)
|
|
.bind(descriptor.phase)
|
|
.bind(descriptor.compatibility)
|
|
.execute(&mut **transaction)
|
|
.await
|
|
.map_err(|_| {
|
|
MigrationError::new(
|
|
"apply_failed",
|
|
"apply.durable_task_input_v30",
|
|
Some(30),
|
|
"restore_known_good_backup",
|
|
)
|
|
})?;
|
|
Ok(())
|
|
}
|