Skip to content

fix(scarab): correct WHERE clause in heartbeat UPDATE#67

Open
gHashTag wants to merge 8 commits into
mainfrom
fix/scarab-update-where-clause
Open

fix(scarab): correct WHERE clause in heartbeat UPDATE#67
gHashTag wants to merge 8 commits into
mainfrom
fix/scarab-update-where-clause

Conversation

@gHashTag
Copy link
Copy Markdown
Owner

Problem: Heartbeats failing because heartbeat() uses WHERE scarab_id = $2 but the PK column is id.

Impact:

  • current_exp_id stays NULL in scarabs table
  • Workers appear dead despite running
  • No experiment tracking

Fix: scarab_idid in WHERE clause (line 211).

Diff:

- WHERE scarab_id = $2::uuid
+ WHERE id = $2::uuid

Dmitrii Vasilev and others added 8 commits May 1, 2026 03:48
- Add tokio-postgres-rustls, rustls, webpki-roots to Cargo.toml
- Fix Dockerfile.scarab: remove invalid -p flag
- Fix scarab.rs: MakeTlsConfig -> MakeRustlsConnect (v0.13 API)
scarabs table uses 'id' as PK, not 'scarab_id'.
This was causing heartbeats to fail and current_exp_id to stay NULL.

Refs: current fleet shows 0 heartbeats despite running workers.
CI failures on PR #67 were:
  1. cargo fmt -- --check : 15-line drift in src/bin/scarab.rs
  2. smoke_train end-to-end : Cargo.lock out of sync with new
     tokio-postgres-rustls / rustls / webpki-roots deps;
     'cargo build --locked' refused to update lockfile.

This commit: cargo fmt applied + Cargo.lock regenerated. No
behavioural change. Build verified locally:
  cargo build --release --bin scarab : clean

Refs: trios-trainer-igla#67 (heartbeat schema fix + TLS support)
- Add --neon CLI argument for passing Neon database URL
- Set NEON_DATABASE_URL env var when --neon is provided
- Enables bpb_samples writes when called from scarab worker

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
trios-train now checks NEON_DATABASE_URL environment variable
before falling back to --neon CLI flag. This allows scarab
workers to pass the Neon DB URL via ENV inheritance instead
of requiring the --neon argument.

Previously, trios-train only read NEON_DATABASE_URL from the
--neon flag, but scarab passes it via ENV. This caused
results to not be written to the database (bpb_samples table).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace NoTls with MakeRustlsConnect for Neon TLS support
- Add RootCertStore and TLS_SERVER_ROOTS for certificate validation
- Install rustls crypto provider for rustls 0.23+ compatibility
- Fixes scarab deployment failures due to TLS connection issues

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.

1 participant