empiredan commented on code in PR #1473:
URL:
https://github.com/apache/incubator-pegasus/pull/1473#discussion_r1226435866
##########
src/replica/replica.cpp:
##########
@@ -304,11 +304,14 @@ void replica::on_client_read(dsn::message_ex *request,
bool ignore_throttling)
auto storage_error = _app->on_request(request);
if (dsn_unlikely(storage_error != ERR_OK)) {
switch (storage_error) {
- // TODO(yingchun): Now only kCorruption is dealt, consider to deal
with more storage
- // engine errors.
+ // TODO(yingchun): Now only kCorruption and kIOError is dealt,
consider to deal with
Review Comment:
```suggestion
// TODO(yingchun): Now only kCorruption and kIOError are dealt,
consider to deal with
```
##########
src/replica/test/replica_disk_test.cpp:
##########
@@ -286,5 +291,28 @@ TEST_F(replica_disk_test, add_new_disk_test)
}
}
+TEST_F(replica_disk_test, disk_io_error_test)
+{
+ // Disable failure detector to avoid connecting with meta server which is
not started.
+ FLAGS_fd_disabled = true;
+
+ gpid test_pid(app_info_1.app_id, 0);
+ const auto rep = stub->get_replica(test_pid);
+ auto *old_dn = rep->get_dir_node();
+
+ rep->handle_local_failure(ERR_DISK_IO_ERROR);
+ ASSERT_EVENTUALLY([&] { ASSERT_TRUE(!old_dn->has(test_pid)); });
+
+ // The replica will not be located on the old dir_node.
+ auto *new_dn =
stub->get_fs_manager()->find_best_dir_for_new_replica(test_pid);
+ ASSERT_NE(old_dn, new_dn);
+
+ // The replicas will not be located on the old dir_node.
+ for (int i = 0; i < 16; i++) {
+ new_dn = stub->get_fs_manager()->find_best_dir_for_new_replica(gpid(3,
i));
Review Comment:
Is it necessary to `CHECK_NE(app_info_1.app_id, 3)` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]