@@ -110,7 +110,7 @@ void NameServerImpl::CheckRecoverMode() {
110
110
work_thread_pool_->DelayTask (1000 , boost::bind (&NameServerImpl::CheckRecoverMode, this ));
111
111
}
112
112
void NameServerImpl::LeaveReadOnly () {
113
- LOG (INFO, " Nameserver leave safemode " );
113
+ LOG (INFO, " Nameserver leave read only " );
114
114
if (readonly_) {
115
115
readonly_ = false ;
116
116
}
@@ -1022,27 +1022,30 @@ bool NameServerImpl::WebService(const sofa::pbrpc::HTTPRequest& request,
1022
1022
ListRecover (&response);
1023
1023
return true ;
1024
1024
} else if (path == " /dfs/hi_only" ) {
1025
+ recover_timeout_ = 0 ;
1025
1026
LOG (INFO, " ChangeRecoverMode hi_only" );
1026
1027
recover_mode_ = kHiOnly ;
1027
1028
response.content ->Append (" <body onload=\" history.back()\" ></body>" );
1028
1029
return true ;
1029
1030
} else if (path == " /dfs/recover_all" ) {
1031
+ recover_timeout_ = 0 ;
1030
1032
LOG (INFO, " ChangeRecoverMode recover_all" );
1031
1033
recover_mode_ = kRecoverAll ;
1032
1034
response.content ->Append (" <body onload=\" history.back()\" ></body>" );
1033
1035
return true ;
1034
1036
} else if (path == " /dfs/stop_recover" ) {
1037
+ recover_timeout_ = 0 ;
1035
1038
LOG (INFO, " ChangeRecoverMode stop_recover" );
1036
1039
recover_mode_ = kStopRecover ;
1037
1040
response.content ->Append (" <body onload=\" history.back()\" ></body>" );
1038
1041
return true ;
1039
- } else if (path == " /dfs/entry_read_only " ) {
1040
- LOG (INFO, " ChangeStatus entry_read_only " );
1042
+ } else if (path == " /dfs/leave_read_only " ) {
1043
+ LOG (INFO, " ChangeStatus leave_read_only " );
1041
1044
LeaveReadOnly ();
1042
1045
response.content ->Append (" <body onload=\" history.back()\" ></body>" );
1043
1046
return true ;
1044
- } else if (path == " /dfs/leave_read_only " ) {
1045
- LOG (INFO, " ChangeStatus leave_read_only " );
1047
+ } else if (path == " /dfs/entry_read_only " ) {
1048
+ LOG (INFO, " ChangeStatus entry_read_only " );
1046
1049
readonly_ = true ;
1047
1050
response.content ->Append (" <body onload=\" history.back()\" ></body>" );
1048
1051
return true ;
@@ -1236,7 +1239,7 @@ bool NameServerImpl::WebService(const sofa::pbrpc::HTTPRequest& request,
1236
1239
str += " <div class=\" col-sm-4 col-md-4\" >" ;
1237
1240
str += " Total: " + common::HumanReadableString (total_quota) + " B</br>" ;
1238
1241
str += " Used: " + common::HumanReadableString (total_data) + " B</br>" ;
1239
- str += " Pending tasks: "
1242
+ str += " Pending: (r/w/rp/h)<br> "
1240
1243
+ common::NumToString (read_thread_pool_->PendingNum ()) + " "
1241
1244
+ common::NumToString (work_thread_pool_->PendingNum ()) + " "
1242
1245
+ common::NumToString (report_thread_pool_->PendingNum ()) + " "
@@ -1249,13 +1252,13 @@ bool NameServerImpl::WebService(const sofa::pbrpc::HTTPRequest& request,
1249
1252
str += " <div class=\" col-sm-4 col-md-4\" >" ;
1250
1253
str += " Status: " ;
1251
1254
if (readonly_) {
1252
- str += " <font color=\" red\" >Read Only</font></br> <a href=\" /dfs/entry_read_only \" >LeaveSafeMode </a>" ;
1255
+ str += " <font color=\" red\" >Read Only</font></br> <a href=\" /dfs/leave_read_only \" >LeaveReadOnly </a>" ;
1253
1256
} else {
1254
- str += " Normal</br> <a href=\" /dfs/leave_read_only \" >EnterSafeMode </a>" ;
1257
+ str += " Normal</br> <a href=\" /dfs/entry_read_only \" >EnterReadOnly </a>" ;
1255
1258
}
1256
1259
str += " </br>" ;
1257
1260
if (recover_timeout_ > 1 ) {
1258
- str += " RecoverCountdown : " + common::NumToString (recover_timeout_) + " </br>" ;
1261
+ str += " Recover : " + common::NumToString (recover_timeout_) + " <a href= \" /dfs/stop_recover \" > Stop</a> </br>" ;
1259
1262
}
1260
1263
str += " RecoverMode: " ;
1261
1264
if (recover_mode_ == kRecoverAll ) {
0 commit comments