Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safe tantivy replication #1755

Merged
merged 6 commits into from
Jan 25, 2024

Conversation

hermeGarcia
Copy link
Contributor

Description

This PR uses a different approach to replication in Tantivy indexes. We were getting errors due to data race conditions, which are a result of us directly accessing Tantivy files without proper safeguards.

How was this PR tested?

Local tests.

Copy link

This pull request has been linked to Shortcut Story #8605: Safe replication in Tantivy.

@hermeGarcia hermeGarcia force-pushed the hermegarcia/sc-8605/safe-replication-in-tantivy branch from 3cb35ac to 670faa5 Compare January 22, 2024 19:27
Copy link

codecov bot commented Jan 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3ad75a1) 82.15% compared to head (060f1bd) 82.13%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1755      +/-   ##
==========================================
- Coverage   82.15%   82.13%   -0.03%     
==========================================
  Files         335      335              
  Lines       19682    19682              
==========================================
- Hits        16170    16165       -5     
- Misses       3512     3517       +5     
Flag Coverage Δ
ingest 69.03% <ø> (-0.03%) ⬇️
node-sidecar 95.39% <ø> (ø)
nucliadb 70.13% <ø> (-0.05%) ⬇️
reader 79.82% <ø> (ø)
sdk 40.64% <ø> (ø)
standalone 88.29% <ø> (ø)
train 63.60% <ø> (ø)
utils 81.42% <ø> (ø)
writer 85.11% <ø> (ø)

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.

@hermeGarcia hermeGarcia force-pushed the hermegarcia/sc-8605/safe-replication-in-tantivy branch from b0d8b75 to 2decd7e Compare January 23, 2024 08:35
@hermeGarcia hermeGarcia force-pushed the hermegarcia/sc-8605/safe-replication-in-tantivy branch from c671535 to bea79f6 Compare January 25, 2024 10:57
Copy link
Contributor

@javitonino javitonino left a comment

Choose a reason for hiding this comment

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

Left a few suggestions, nothing blocking.

As a general comment, this ties us a bit more onto the specific tantivy version, but it seems pretty much inevitable.

nucliadb_core/src/tantivy_replica.rs Show resolved Hide resolved
chunk_size: u64,
shard_path: &Path,
generation_id: &str,
_index_prefix: PathBuf,
Copy link
Contributor

Choose a reason for hiding this comment

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

I find it a bit confusing that tantivy returns paths relative to the index and raw (vectors) returns paths relative to the shard. Would it be possible to change vectors so that it's also using paths relative to the index?

Feel free to say no, I saw something regarding vectors and vectorset which looks a bit tricky.

In any case, it would be nice to keep this in mind for vectors2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are totally right, the only reason why I did not unify the approach was to not overload the PR. I was trying to add the tantivy thing while changing the surroundings as little as possible. If you want I can unify in the same PR!

nucliadb_core/src/tantivy_replica.rs Outdated Show resolved Hide resolved
@hermeGarcia hermeGarcia merged commit 1bffdc8 into main Jan 25, 2024
103 checks passed
@hermeGarcia hermeGarcia deleted the hermegarcia/sc-8605/safe-replication-in-tantivy branch January 25, 2024 14:13
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.

2 participants