Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Jun 4, 2023
1 parent fa0389b commit 0105cfc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/common/fs_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ void fs_manager::specify_dir_for_new_replica_for_test(dir_node *specified_dn,
}
}
CHECK(dn_found, "dir_node({}) is not exist", specified_dn->tag);
CHECK_EQ(disk_status::NORMAL, dn_found->status);
CHECK_EQ(disk_status::NORMAL, specified_dn->status);
const auto dir = specified_dn->replica_dir(app_type, pid);
CHECK_TRUE(dsn::utils::filesystem::create_directory(dir));
specified_dn->holding_replicas[pid.get_app_id()].emplace(pid);
Expand Down Expand Up @@ -567,7 +567,9 @@ fs_manager::validate_migrate_task(gpid pid,
if (dn->status == disk_status::SPACE_INSUFFICIENT ||
dn->status == disk_status::IO_ERROR) {
err_msg = fmt::format("replica({}) target disk({}) is {}",
pid, origin_disk, enum_to_string(dn->status));
pid,
origin_disk,
enum_to_string(dn->status));
return disk_migrate_validation::kDiskIOError;
}

Expand Down
3 changes: 1 addition & 2 deletions src/replica/replica_2pc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ void replica::on_client_write(dsn::message_ex *request, bool ignore_throttling)
}

if (FLAGS_reject_write_when_disk_insufficient &&
(_dir_node->status != disk_status::NORMAL ||
_primary_states.secondary_disk_abnormal())) {
(_dir_node->status != disk_status::NORMAL || _primary_states.secondary_disk_abnormal())) {
response_client_write(request, ERR_DISK_INSUFFICIENT);
return;
}
Expand Down
2 changes: 2 additions & 0 deletions src/utils/error_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,6 @@ DEFINE_ERR_CODE(ERR_RANGER_POLICIES_NO_NEED_UPDATE)

DEFINE_ERR_CODE(ERR_RDB_CORRUPTION)
DEFINE_ERR_CODE(ERR_RDB_IO_ERROR)

DEFINE_ERR_CODE(ERR_DISK_IO_ERROR)
} // namespace dsn

0 comments on commit 0105cfc

Please sign in to comment.