CI / UI Checks (pull_request) Successful in 15s
CI / Rust Checks (pull_request) Failing after 4m58s
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) Failing after 1s
CI / Deploy (pull_request) Skipped
mcp-server запускает сохранённые фоновые задачи: захват по PostgreSQL lease с fence-токеном, зашифрованный input и повторная проверка доступа до сетевого вызова, checkpoint с AttemptID до dispatch и восстановление только по PG. Устаревший worker не может зафиксировать результат. Добавлены миграции v26–v28 (V25 не меняется), guard их отсутствия в старой схеме, метрики/трассы попыток (attempt_trace) и остановка до отправки запроса: стоп в окне после checkpoint и до permit завершает задачу как failed(shutdown_before_dispatch) без сетевых вызовов, соседние queued-задачи остаются доступными. Retry-попытки получают отдельные дочерние spans с durable current_attempt_id. Shared admission/fairness из Story 4.1 сохранены. Проверки: durable_tasks 13/13, stages 11/11 (retry 5), runtime lib 47, bin shutdown 1, registry tasks 16, admission 11, migrations 58 (независимая QA и исходный runtime-прогон), точный exact-head CI остаётся обязательным.
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-tasks-v26";
|
|
pub(super) const SOURCE: &str = include_str!("durable_tasks_v26.sql");
|
|
pub(super) const SOURCE_SHA256: &str =
|
|
"6dcbf9990deabb3984a333acbfc3cb490cfc886c2ec30093e3b46d9113616089";
|
|
|
|
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_tasks_v26",
|
|
Some(26),
|
|
"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_tasks_v26",
|
|
Some(26),
|
|
"restore_known_good_backup",
|
|
)
|
|
})?;
|
|
Ok(())
|
|
}
|