Skip to content

Commit 103f011

Browse files
author
wangguangshuo
committed
fix comment
1 parent 985b0c1 commit 103f011

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

src/replica/replica_2pc.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,21 +181,22 @@ void replica::on_client_write(dsn::message_ex *request, bool ignore_throttling)
181181
return;
182182
}
183183

184-
if (FLAGS_reject_write_when_disk_insufficient &&
185-
(_dir_node->status != disk_status::NORMAL || _primary_states.secondary_disk_abnormal())) {
184+
if (FLAGS_reject_write_when_disk_insufficient) {
186185
if (_dir_node->status != disk_status::NORMAL) {
187186
// Primary replica disk is abnormal, return the corresponding error code
188187
response_client_write(request, disk_status_to_error_code(_dir_node->status));
189-
} else {
190-
// Secondary replica disk is abnormal but primary is OK
191-
for (const auto &kv : _primary_states.secondary_disk_status) {
192-
if (kv.second != disk_status::NORMAL) {
193-
response_client_write(request, disk_status_to_error_code(kv.second));
194-
break;
195-
}
188+
return;
189+
}
190+
for (const auto &[addr, secondary_status] : _primary_states.secondary_disk_status) {
191+
if (secondary_status != disk_status::NORMAL) {
192+
LOG_INFO("partition[{}] secondary[{}] disk status is {}",
193+
_primary_states.pc.pid,
194+
addr,
195+
enum_to_string(secondary_status));
196+
response_client_write(request, disk_status_to_error_code(secondary_status));
197+
return;
196198
}
197199
}
198-
return;
199200
}
200201

201202
if (_is_bulk_load_ingestion) {

0 commit comments

Comments
 (0)