Skip to content

feat: add inline optimization for dir namespace#5244

Merged
jackye1995 merged 4 commits intolance-format:mainfrom
jackye1995:manifest-optimization
Nov 15, 2025
Merged

feat: add inline optimization for dir namespace#5244
jackye1995 merged 4 commits intolance-format:mainfrom
jackye1995:manifest-optimization

Conversation

@jackye1995
Copy link
Copy Markdown
Contributor

Additional remaining work in lancedb/lancedb#2708

@github-actions github-actions Bot added the enhancement New feature or request label Nov 14, 2025
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 639 to +794
} // Drop the guard here

self.manifest_dataset.reload().await?;

// Run inline optimization after delete
self.run_inline_optimization().await?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Inline optimization failures break manifest operations

After inserting into the __manifest table we immediately call self.run_inline_optimization().await?; (lines 767‑772), and the same happens after deletions (lines 790‑794). The manifest row has already been merged or deleted before this call, yet any error from creating indexes, compacting files, or optimizing indices bubbles up to the caller. This makes user operations non‑atomic: a transient failure during the optional optimization causes create_table/register_table to report an error even though the entry was already added, and drop_table/deregister_table returns an error after the manifest row is gone, preventing the physical data cleanup from running and leaving orphaned files. Inline optimization should be best‑effort or rolled back; as written it can leave the namespace in an inconsistent state whenever compaction or index maintenance fails.

Useful? React with 👍 / 👎.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 67.59259% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.27%. Comparing base (7c19c22) to head (a0073d4).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
rust/lance-namespace-impls/src/dir/manifest.rs 64.94% 24 Missing and 10 partials ⚠️
rust/lance-namespace-impls/src/dir.rs 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5244      +/-   ##
==========================================
+ Coverage   82.23%   82.27%   +0.03%     
==========================================
  Files         344      344              
  Lines      144765   144472     -293     
  Branches   144765   144472     -293     
==========================================
- Hits       119050   118865     -185     
+ Misses      21797    21682     -115     
- Partials     3918     3925       +7     
Flag Coverage Δ
unittests 82.27% <67.59%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +403 to +406
log::info!(
"Created BTREE index '{}' on object_id for __manifest table",
OBJECT_ID_INDEX_NAME
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be info level? Or maybe debug level. Seems like it would be noisy at info level.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I felt info was better because this is a one time creation

@jackye1995 jackye1995 merged commit 1b0dad4 into lance-format:main Nov 15, 2025
25 checks passed
jackye1995 added a commit to jackye1995/lance that referenced this pull request Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants