Skip to content

Commit

Permalink
Handle DataNode failures in replicated writes (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimahriman authored Dec 5, 2024
1 parent c7d40bd commit f72ab92
Show file tree
Hide file tree
Showing 8 changed files with 599 additions and 302 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/minidfs/src/main/java/main/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static void main(String args[]) throws Exception {
} else {
MiniDFSNNTopology nnTopology = generateTopology(flags, hdfsConf);

int numDataNodes = 1;
int numDataNodes = 3;
if (flags.contains("ec")) {
// Enough for the largest EC policy
numDataNodes = 14;
Expand Down
8 changes: 2 additions & 6 deletions rust/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,7 @@ impl FileWriter {
// Not appending to an existing block, just create a new one
// If there's an existing block writer, close it first
let extended_block = if let Some(block_writer) = self.block_writer.take() {
let extended_block = block_writer.get_extended_block();
block_writer.close().await?;
Some(extended_block)
Some(block_writer.close().await?)
} else {
None
};
Expand Down Expand Up @@ -265,9 +263,7 @@ impl FileWriter {
pub async fn close(&mut self) -> Result<()> {
if !self.closed {
let extended_block = if let Some(block_writer) = self.block_writer.take() {
let extended_block = block_writer.get_extended_block();
block_writer.close().await?;
Some(extended_block)
Some(block_writer.close().await?)
} else {
None
};
Expand Down
Loading

0 comments on commit f72ab92

Please sign in to comment.