limowang commented on code in PR #2387:
URL: 
https://github.com/apache/incubator-pegasus/pull/2387#discussion_r3031801735


##########
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:
   Your suggestion is very reasonable, and I will make the changes accordingly.
   



-- 
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]

Reply via email to