Skip to content

fix(reindex): --missing-metadata skips rows attempted in the last 24h - #552

Closed
neuromechanist wants to merge 0 commit into
devfrom
fix/reindex-missing-metadata-recency
Closed

neuromechanist wants to merge 0 commit into
devfrom
fix/reindex-missing-metadata-recency

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Problem

nemar admin reindex --missing-metadata re-runs the same datasets every sweep with no progress for cases where upstream genuinely lacks a required column. Reported on nm000133: its GitHub repo has no participants.tsv, so subject_count stays NULL forever; the filter re-matches every sweep; the reindex re-runs and produces the same null; the cycle is stable.

-- before
AND (subject_count IS NULL OR modalities IS NULL OR file_size IS NULL OR total_files IS NULL)

Affects every dataset whose upstream is missing one of the four required fields. Same observation on on005262 (no participants.tsv).

Fix

Add a 24h recency guard so a row attempted within the last day isn't re-queued:

AND (subject_count IS NULL OR modalities IS NULL OR file_size IS NULL OR total_files IS NULL)
AND (metadata_updated_at IS NULL OR metadata_updated_at < datetime('now', ?))

Default lookback = 1 day. Operator can override with --older-than 0 to force immediate retry or --all to bypass.

Tests

Existing missing-metadata test extended to assert the new params binding + the recency predicate. Two new tests pin the override behavior and negative-recency rejection. 21/21 pass.

@neuromechanist
neuromechanist force-pushed the fix/reindex-missing-metadata-recency branch from d12e28d to 95a8a52 Compare May 18, 2026 17:14
@neuromechanist
neuromechanist force-pushed the fix/reindex-missing-metadata-recency branch from 95a8a52 to badd48c Compare May 22, 2026 18:12
neuromechanist added a commit that referenced this pull request May 22, 2026
…#579)

Adds a recency guard to the reindex --missing-metadata filter so datasets whose upstream genuinely lacks required columns (e.g. nm000133 has no participants.tsv → subject_count stays NULL) don't get reindexed every hour with no progress. Default 24h; force-retry via --all. Replaces auto-closed #552. Companion to #553.

This branch was previously deployed

2 inactive deployments
npm — badd48c6 Deployed May 22, 2026 by neuromechanist via publish #1050
development — badd48c6 Deployed May 22, 2026 by neuromechanist via deploy-dev #348
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