Startup scan: warn (don't silently skip) when the reserved `restore` metadata dir looks like a database
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- databases
Research direction
Start in resources/databases.ts at the startup scan loops and review how the reserved restore entry is skipped. Check the entry for CURRENT and MANIFEST-* before it is ignored, then warn or fail clearly when it looks like a database. Done means a conflicting restore directory is no longer silently skipped and normal startup scanning still works.
Written by the indexing model from the issue text.
Description
Follow-up from #1831 review (flagged by @kriszyp on resources/databases.ts).
Context
#1831 stores restore lock/marker metadata in a reserved restore directory beside the database directories. The backtick makes it an illegal database name (schemaRegex rejects / and backtick), so the API can never create a database that collides with it, and the startup scan explicitly skips that entry.
Edge case
The startup scan opens any directory containing CURRENT + MANIFEST-* without re-applying schemaRegex. So if a directory literally named restore already exists on disk as a RocksDB database (only reachable via manual filesystem creation, since the API always rejected backticks), an upgrade to this code now silently stops loading that database, and a subsequent restore would write .lock/.restoring metadata into it.
Severity
Very low probability (no API path can produce such a directory), but the silent disappearance is a bad state to hit undiagnosed.
Suggested fix
When the scan skips the reserved restore entry, detect whether it looks like a real database (has CURRENT + MANIFEST-*) and log a warning (or refuse startup with a clear message) rather than silently ignoring it, so an operator can migrate/rename it.
Ref: #1831, resources/databases.ts scan loops.
- Dominant language
- JavaScript
- Stars
- 89
- Forks
- 10
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 196
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HarperFast/harper
-
Derived index logs [error] "backend has no durable cursor undefined" at startup on a brand-new index Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
HarperFast/harper#2696 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
HarperFast/harper#2650 ·
-
Runtime guard on HierarchicalNavigableSmallWorld.search() options argument (follow-up to #2165) Open
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
HarperFast/harper#2611 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
HarperFast/harper#2547 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
HarperFast/harper#2503 ·
All issues in HarperFast/harper
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·