Skip to content

feat(internal): add index creation retry logic with exponential backoff (BL-048)#58

Merged
tryweb merged 3 commits intomainfrom
feat/bl-048-lancedb-index-recovery
Apr 3, 2026
Merged

feat(internal): add index creation retry logic with exponential backoff (BL-048)#58
tryweb merged 3 commits intomainfrom
feat/bl-048-lancedb-index-recovery

Conversation

@tryweb
Copy link
Copy Markdown
Owner

@tryweb tryweb commented Apr 3, 2026

Summary

  • BL-048 implementation complete: LanceDB index creation now has retry logic with exponential backoff
  • Handles transient LanceDB index creation conflicts gracefully
  • Adds idempotency check using table.listIndices() before attempting index creation
  • Adds structured logging and retry count tracking for observability

Verification

  • openspec validate: passed
  • Unit tests: 32/32 passed
  • Documentation: CHANGELOG.md updated

Changes

  • src/store.ts: Added createVectorIndexWithRetry() and createFtsIndexWithRetry() with exponential backoff (500ms → 1s → 2s)
  • src/store.ts: Extended LanceTable type to include listIndices()
  • src/store.ts: Extended getIndexHealth() to return vectorRetries and ftsRetries
  • docs/backlog.md: Updated BL-048 status to done
  • docs/roadmap.md: Updated BL-048 to DONE v0.6.1

Notes

  • This is an internal-only change - no new user-facing capabilities
  • Vector index may fail in Docker test environment (empty table), but fallback to in-memory search works correctly
  • Retry logic verified via test output showing: Vector index creation failed (attempt 1/3)... Retrying in 500ms...

Test Output Sample

[store] Vector index creation failed (attempt 1/3): lance error: ... Retrying in 500ms...
[store] Vector index creation failed (attempt 2/3): ... Retrying in 1000ms...
[store] Vector index creation failed after 3 attempts: ... Falling back to in-memory search.
[store] FTS index created successfully on attempt 1

tryweb added 3 commits April 3, 2026 17:52
- Add retry logic with exponential backoff (3 attempts: 500ms, 1s, 2s) for LanceDB index creation
- Add idempotency check using table.listIndices() before attempting index creation
- Add structured logging for index creation attempts and failures
- Track vectorRetries and ftsRetries in indexState for observability
- Extend getIndexHealth() to return retry counts
- Add listIndices() to LanceTable type definition

Spec: openspec/changes/bl-048-lancedb-index-recovery/
Surface: internal-api
Update backlog.md with BL-048 completion status.
@tryweb tryweb merged commit 78a43bd into main Apr 3, 2026
9 checks passed
@tryweb tryweb deleted the feat/bl-048-lancedb-index-recovery branch April 3, 2026 09:57
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