Skip to content

Commit

Permalink
stop replication when suspecting a partial shard (#1744)
Browse files Browse the repository at this point in the history
  • Loading branch information
hermeGarcia authored Jan 19, 2024
1 parent c3f6c03 commit f418b65
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions nucliadb_node/src/replication/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::path::{Path, PathBuf};
use std::sync::Arc;

use nucliadb_core::tracing::{debug, error, info, warn};
use nucliadb_core::NodeResult;
use nucliadb_core::{node_error, NodeResult};
use nucliadb_protos::{noderesources, replication};
use tokio::fs::File;
use tokio::io::AsyncReadExt;
Expand Down Expand Up @@ -73,11 +73,9 @@ async fn stream_file(
let filepath = shard_path.join(rel_filepath);

if !filepath.exists() {
debug!(
"File not found when index thought it should be: {}",
filepath.to_string_lossy(),
);
return Ok(());
return Err(node_error!(
"This file can not be streamed because it does not exist"
));
}

debug!("Streaming file {}", filepath.to_string_lossy());
Expand Down

3 comments on commit f418b65

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: f418b65 Previous: 5a633b0 Ratio
nucliadb/search/tests/unit/search/test_fetch.py::test_highligh_error 12933.367304029956 iter/sec (stddev: 0.0000023992748255468187) 12745.686329086004 iter/sec (stddev: 1.7317806991721728e-7) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: f418b65 Previous: 5a633b0 Ratio
nucliadb/search/tests/unit/search/test_fetch.py::test_highligh_error 12955.014950726481 iter/sec (stddev: 8.50143308134075e-8) 12745.686329086004 iter/sec (stddev: 1.7317806991721728e-7) 0.98

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: f418b65 Previous: 5a633b0 Ratio
nucliadb/search/tests/unit/search/test_fetch.py::test_highligh_error 12921.083076168363 iter/sec (stddev: 3.7604820555409336e-7) 12745.686329086004 iter/sec (stddev: 1.7317806991721728e-7) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.