Skip to content

Commit 7fd21c9

Browse files
fix(log-ingestor): Enforce atomic job status validation using a shared lock. (y-scope#2045)
1 parent eaf8c31 commit 7fd21c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/log-ingestor/src/ingestion_job_manager/clp_ingestion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ impl ClpIngestionState {
334334
mut tx: sqlx::Transaction<'_, sqlx::MySql>,
335335
) -> anyhow::Result<()> {
336336
let curr_status: ClpIngestionJobStatus = sqlx::query_scalar(formatcp!(
337-
r"SELECT `status` FROM `{table}` WHERE `id` = ?",
337+
r"SELECT `status` FROM `{table}` WHERE `id` = ? LOCK IN SHARE MODE;",
338338
table = INGESTION_JOB_TABLE_NAME,
339339
))
340340
.bind(self.job_id)

0 commit comments

Comments
 (0)