Skip to content

Fix coordinator/schema drift and replace the synthetic smoke test - #4

Closed
sounkou-bioinfo wants to merge 2 commits into
mainfrom
review/coordinator-real-schema
Closed

sounkou-bioinfo wants to merge 2 commits into
mainfrom
review/coordinator-real-schema

Conversation

@sounkou-bioinfo

Copy link
Copy Markdown
Member

Review finding

Reviewed against 052c7b42f783f021cdb0044888fdb016dd581b3b.

The native reaper referred to completed_at and lease_token, neither of which exists in inst/sql/schema.sql. Its integration test created a second, incompatible task schema containing those names, so it could pass without exercising CanardAbsurd's actual contract.

Reproduced with the unmodified extension and the actual package schema on DuckDB v1.5.5-dev262 (official CI binary at release-code commit d8cdaa33fd):

Coordinator error: Binder Error: Referenced update column completed_at not found in table!
Did you mean: "created_at"

Changing column names alone would still be wrong: terminal expiry must increment failures, record the reason, and clear worker, token, and lease_until together.

Changes

  • Align the native all-queues reaper with the failure transition in inst/sql/reap.sql, including RETURNING 1 AS changed, id.
  • Replace the hand-written schema in test-v1.R with the package's actual schema. Check failure accounting, ownership clearance, native input/checkpoint preservation, and noninterference with retryable, live, ready, and terminal tasks. Exercise two queues with a reap limit of one.
  • Put test execution inside a function so on.exit() actually provides cleanup. Stop the coordinator before disconnecting, including on assertion failures. Surface polling errors immediately instead of hiding them behind a timeout.
  • Separate prepare, execute, and error handling in the C polling loop rather than encoding them in a compound condition. Remove the obsolete unused-input cast.
  • Enable DuckDB's special NULL handling for the start function so its existing NULL-argument validation is actually reached. Add rejection checks for NULL and zero arguments.

This is deliberately a two-file change. No new scheduler, generic registration framework, schema migration, dependencies, generated reports, or test runner is added. The existing lease/checkpoint protocol and one-shot coordinator lifecycle are retained.

Validation

  • Compiled the extension with C11, -Wall -Wextra -Werror, targeting C extension API v1.2.0; also checked compilation against the pinned 1.5.5 SDK headers.
  • A local C regression driver against the actual package schema reproduced the original binder failure and passed after this change. It checked NULL/zero rejection, both queues, the complete failure transition, preserved native payloads/checkpoints, untouched ineligible tasks, duplicate start, stop/repeated stop, and rejected restart.
  • Repeated the native checks with AddressSanitizer, UndefinedBehaviorSanitizer, and leak detection: no diagnostics. The linked DuckDB library was not instrumented.
  • git diff --check passed.

Not run locally: the revised R script, make document, make test, make check, and the repository's Tree-sitter audit. This sandbox has no R installation and cannot clone/fetch dependencies directly. The existing coordinator CI matrix already invokes test-v1.R on Linux, macOS, and Windows; its result must be checked before merging. The native validation does not claim to replace R or Quack integration tests.

The supplied article informed the review focus: readable production control flow and tests that exercise the real implementation, rather than shorter code or more verification machinery.

Use the package's failure transition instead of nonexistent completed_at
and lease_token columns. Exercise the actual schema, native checkpoints,
failure counters and excluded task states in the existing integration test.

Make prepare/execute/error handling explicit in the poll loop, enable the
existing NULL-argument guard, and stop the coordinator on test failures.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-16T22:02:12.918193Z 1291e9c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Keep the shared_home = FALSE change in the rewritten coordinator test.
All other changes from main are retained without modification.
@sounkou-bioinfo

Copy link
Copy Markdown
Member Author

Superseded by #3, which applies the same reaper transition and adds installed-package integration coverage plus partial-registration cleanup. The corrected native checks in #3 now pass on Linux, macOS, and Windows.

@sounkou-bioinfo
sounkou-bioinfo deleted the review/coordinator-real-schema branch September 17, 2026 12:27
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.

1 participant