You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by "levy5307 (via GitHub)" <gi...@apache.org> on 2023/06/08 01:38:08 UTC

[GitHub] [incubator-pegasus] levy5307 commented on a diff in pull request #1512: feat: skip IO_ERROR dir_node when assign replicas

levy5307 commented on code in PR #1512:
URL: https://github.com/apache/incubator-pegasus/pull/1512#discussion_r1222351221


##########
src/replica/replica_2pc.cpp:
##########
@@ -116,6 +117,21 @@ DSN_DEFINE_uint64(
 DSN_DECLARE_int32(max_mutation_count_in_prepare_list);
 DSN_DECLARE_int32(staleness_for_commit);
 
+namespace {
+error_code disk_status_to_error_code(disk_status::type ds)
+{
+    switch (ds) {
+    case disk_status::SPACE_INSUFFICIENT:
+        return dsn::ERR_DISK_INSUFFICIENT;
+    case disk_status::IO_ERROR:
+        return dsn::ERR_DISK_IO_ERROR;
+    default:

Review Comment:
   It's better to move `disk_status::NORMAL` in front of all other cases to improve cache efficiency



-- 
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: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org