Skip to content

fix(compression-coordinator): Ensure running Spider jobs always have a dispatch_time. - #2462

Open
Bill-hbrhbr wants to merge 3 commits into
y-scope:mainfrom
Bill-hbrhbr:coordinator/ensure-running-job-with-dispatch-time
Open

fix(compression-coordinator): Ensure running Spider jobs always have a dispatch_time.#2462
Bill-hbrhbr wants to merge 3 commits into
y-scope:mainfrom
Bill-hbrhbr:coordinator/ensure-running-job-with-dispatch-time

Conversation

@Bill-hbrhbr

@Bill-hbrhbr Bill-hbrhbr commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Description

The compression coordinator can leave a Running job without a dispatch_time if it restarts after persist_spider_job_id changes the job from Pending to Running, but before the batched mark_jobs_dispatched update at the end of the polling interval.

On the next startup, the recovery process picks up Running jobs with a spider_id and resumes them via to_completion(), but does not populate the missing dispatch_time.

To keep dispatch_time representative of when the job was actually dispatched, persist_spider_job_id now also sets it if it has not already been set by the coordinator. This ensures the timestamp is recorded close to the actual dispatch rather than being reconstructed after a restart.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • Benign SQL query string update that doesn't affect coordinator's functional correctness.

Summary by CodeRabbit

  • Bug Fixes
    • Preserved existing job dispatch timestamps instead of overwriting them.
    • Ensured running compression jobs receive a dispatch timestamp when one is not already set.
    • Improved timestamp accuracy for jobs whose dispatch time is recorded by the job handler.

@Bill-hbrhbr
Bill-hbrhbr requested a review from a team as a code owner August 8, 2026 01:29
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 268c81b2-04c6-4734-b97f-6906440b2d35

📥 Commits

Reviewing files that changed from the base of the PR and between 6aa5533 and 1df15e1.

📒 Files selected for processing (1)
  • components/compression-coordinator/src/coordination.rs
💤 Files with no reviewable changes (1)
  • components/compression-coordinator/src/coordination.rs

Walkthrough

The compression coordinator now preserves existing dispatch_time values. The job handler and coordinator assign the current timestamp only when dispatch_time is unset. Documentation describes this behaviour.

Changes

Dispatch timestamp persistence

Layer / File(s) Summary
Conditional dispatch timestamp updates
components/compression-coordinator/src/job_handle.rs, components/compression-coordinator/src/coordination.rs
Both compression-job updates preserve existing dispatch_time values and assign the current timestamp only when the value is NULL. The method documentation reflects this behaviour.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • y-scope/clp issue 2461 — Both changes address dispatch_time handling in mark_jobs_dispatched and compression-job recovery.

Possibly related PRs

  • y-scope/clp#2405 — This PR updates persist_spider_job_id, which was introduced by the related change.
  • y-scope/clp#2417 — This PR refines the dispatch timestamp update in coordination.rs.
  • y-scope/clp#2420 — Both PRs modify the compression-job timestamp update in job_handle.rs.

Suggested reviewers: linzhihao-723

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: ensuring running Spider jobs have a dispatch timestamp.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LinZhihao-723 LinZhihao-723 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One docstring update otherwise lgtm.

Comment thread components/compression-coordinator/src/coordination.rs Outdated
Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants