limowang commented on code in PR #2387:
URL:
https://github.com/apache/incubator-pegasus/pull/2387#discussion_r2958168265
##########
src/replica/replica_2pc.cpp:
##########
@@ -183,7 +183,13 @@ 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())) {
- response_client_write(request,
disk_status_to_error_code(_dir_node->status));
+ if (_dir_node->status != disk_status::NORMAL) {
+ // Primary replica disk is abnormal, return the corresponding
error code
+ response_client_write(request,
disk_status_to_error_code(_dir_node->status));
+ } else {
+ // Secondary replica disk is abnormal but primary is OK
+ response_client_write(request, ERR_REPLICATION_FAILURE);
Review Comment:
Thank you very much for your suggestion. I have introduced a more precise
error code, `ERR_SECONDARY_DISK_ABNORMAL`, to indicate that the disk on the
node hosting the secondary replica is abnormal (either insufficient disk space
or an I/O error).
--
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]