Skip to content

Commit c8ecf3d

Browse files
committed
Address tests
1 parent ee9eb7f commit c8ecf3d

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

rust/minidfs/src/main/java/main/Main.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public static void main(String args[]) throws Exception {
136136
dfs.transitionToActive(2);
137137
} else if (flags.contains("ha")) {
138138
activeNamenode = 2;
139-
// dfs.transitionToObserver(1);
139+
dfs.transitionToObserver(1);
140140
dfs.transitionToActive(activeNamenode);
141141
}
142142

rust/src/hdfs/proxy.rs

+15-9
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl NameServiceProxy {
114114
async fn msync_if_needed(&self, write: bool) -> Result<()> {
115115
if !self.msycned.fetch_or(true, Ordering::SeqCst) && !write {
116116
let msync_msg = hdfs::MsyncRequestProto::default();
117-
self.call_inner("msync", msync_msg.encode_length_delimited_to_vec(), false)
117+
self.call_inner("msync", msync_msg.encode_length_delimited_to_vec(), true)
118118
.await
119119
.map(|_| ())
120120
.or_else(|err| match err {
@@ -196,17 +196,23 @@ impl NameServiceProxy {
196196
}
197197
Err(_) if attempts >= self.proxy_connections.len() - 1 => return result,
198198
// Retriable error, do nothing and try the next connection
199-
Err(HdfsError::RPCError(exception, _)) => match exception.as_ref() {
200-
OBSERVER_RETRY_EXCEPTION => {
201-
self.current_observers.lock().unwrap().insert(proxy_index);
202-
}
203-
STANDBY_EXCEPTION => {
204-
self.current_observers.lock().unwrap().remove(&proxy_index);
199+
Err(HdfsError::RPCError(exception, _))
200+
| Err(HdfsError::FatalRPCError(exception, _))
201+
if Self::is_retriable(&exception) =>
202+
{
203+
match exception.as_ref() {
204+
OBSERVER_RETRY_EXCEPTION => {
205+
self.current_observers.lock().unwrap().insert(proxy_index);
206+
}
207+
STANDBY_EXCEPTION => {
208+
self.current_observers.lock().unwrap().remove(&proxy_index);
209+
}
210+
_ => (),
205211
}
206-
_ => (),
207-
},
212+
}
208213
Err(e) => {
209214
// Some other error, we will retry but log the error
215+
self.current_observers.lock().unwrap().remove(&proxy_index);
210216
warn!("{:?}", e);
211217
}
212218
}

rust/src/security/sasl.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bytes::{Buf, BufMut, Bytes, BytesMut};
22
use cipher::{KeyIvInit, StreamCipher};
3-
use log::{debug, warn};
3+
use log::debug;
44
use prost::Message;
55
use std::io;
66
use std::sync::{Arc, Mutex};
@@ -262,11 +262,6 @@ impl SaslReader {
262262
));
263263
}
264264
RpcStatusProto::Fatal => {
265-
warn!(
266-
"RPC fatal error: {}: {}",
267-
rpc_response.exception_class_name(),
268-
rpc_response.error_msg()
269-
);
270265
return Err(HdfsError::FatalRPCError(
271266
rpc_response.exception_class_name().to_string(),
272267
rpc_response.error_msg().to_string(),

0 commit comments

Comments
 (0)