Skip to content

fix(merge): gate error-code emission and never let a code outrank 401/403 - #347

Merged
beinan merged 1 commit into
lance-format:mainfrom
beinan:fix/error-code-rollout-and-priority
Oct 8, 2026
Merged

beinan merged 1 commit into
lance-format:mainfrom
beinan:fix/error-code-rollout-and-priority

Conversation

@beinan

@beinan beinan commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Part of #333. Fixes two defects in #338 found in review (credit: production review).

Problems

  1. Mixed-version regression (P1). fix(merge): classify stale preparations by a stable error code #338 changed the exact string old masters match on. A stale preparation produced by a new executor and classified by an old master → DataOrConfiguration, one-hour cooldown — the bug fix(merge): classify stale preparations by a stable error code #338 set out to fix. Reproduced with old vs new classifier.
  2. Code outranks a 403 (P2). classify checked the code before HTTP status, so HTTP 403: … [LC_STALE_PREPARATION] → Retryable. The fix(merge): classify stale preparations by a stable error code #338 description claimed a test for this; there was none. corrected() also had its own rule instead of sharing classify's.

Fixes

  • Emission off by default; MAINTENANCE_ERROR_CODES=1 enables it after every master/executor runs a code-aware reader. tag() returns the exact legacy string when off; tag_forced() for tests.
  • Code moved to a suffix; the legacy text matcher tolerates the suffix (defence in depth for a reader with only the text path).
  • classify order: ownership → explicit 401/403 → code → text. corrected() delegates to classify and only softens a stored DataOrConfiguration.
  • docs/concurrent-indexing.md documents the rollout order.

Validation

  • New: 401/403 wrapping the code in either position → DataOrConfiguration, and corrected() leaves it; emission off by default; byte-exact legacy string still matched; tagged string recognised by text path alone.
  • lance-context-api 1/1, lance-context-merge failure 7/7, lance-context-core prepared/stale 9/9; clippy -D warnings, fmt, typos clean.

🤖 Generated with Claude Code

…/403

Review of lance-format#338 found two defects.

Mixed-version regression: tagging the message changed the exact string
an old master matches on, so a stale preparation completed by a new
executor and classified by an old master went back to a one-hour
cooldown - the production failure lance-format#338 set out to fix. Emission is now
off by default and enabled with MAINTENANCE_ERROR_CODES=1 once every
master and executor runs a code-aware reader. The code moves to a
suffix, and the legacy exact-text matcher tolerates that suffix, so
even a reader with only the text path is not fooled once emission is
on.

Classification priority: the code was checked before HTTP status, so
"HTTP 403: ... [LC_STALE_PREPARATION]" classified Retryable. The PR
description claimed a test for this; there was none. Order is now
ownership, then explicit 401/403, then code, then text. corrected()
reuses classify() instead of its own rule, and only ever softens a
stored DataOrConfiguration record.

Tests: 401/403 wrapping the code in either position classify
DataOrConfiguration and are not softened by corrected(); emission is
off by default; the exact legacy string is still matched byte-for-byte;
a tagged string is recognised by the text path alone. api, merge
(7 unit) and core prepared/stale suites pass; clippy -D warnings, fmt,
typos clean.

Refs lance-format#333.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@beinan
beinan merged commit 80deee3 into lance-format:main Oct 8, 2026
11 checks passed
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