2121import org .apache .doris .common .io .Text ;
2222import org .apache .doris .common .io .Writable ;
2323import org .apache .doris .common .util .DebugPointUtil ;
24+ import org .apache .doris .system .Backend ;
2425import org .apache .doris .thrift .TUniqueId ;
2526
2627import com .google .gson .annotations .SerializedName ;
@@ -597,8 +598,16 @@ public String toStringSimple(boolean checkBeAlive) {
597598 strBuffer .append (", backendId=" );
598599 strBuffer .append (backendId );
599600 if (checkBeAlive ) {
600- strBuffer .append (", backendAlive=" );
601- strBuffer .append (Env .getCurrentSystemInfo ().checkBackendAlive (backendId ));
601+ Backend backend = Env .getCurrentSystemInfo ().getBackend (backendId );
602+ if (backend == null ) {
603+ strBuffer .append (", backend=null" );
604+ } else {
605+ strBuffer .append (", backendAlive=" );
606+ strBuffer .append (backend .isAlive ());
607+ if (backend .isDecommissioned ()) {
608+ strBuffer .append (", backendDecommission=true" );
609+ }
610+ }
602611 }
603612 strBuffer .append (", version=" );
604613 strBuffer .append (version );
@@ -610,6 +619,20 @@ public String toStringSimple(boolean checkBeAlive) {
610619 strBuffer .append (", lastFailedTimestamp=" );
611620 strBuffer .append (lastFailedTimestamp );
612621 }
622+ if (isBad ()) {
623+ strBuffer .append (", isBad=true" );
624+ Backend backend = Env .getCurrentSystemInfo ().getBackend (backendId );
625+ if (backend != null && pathHash != -1 ) {
626+ DiskInfo diskInfo = backend .getDisks ().values ().stream ()
627+ .filter (disk -> disk .getPathHash () == pathHash )
628+ .findFirst ().orElse (null );
629+ if (diskInfo == null ) {
630+ strBuffer .append (", disk with path hash " + pathHash + " not exists" );
631+ } else if (diskInfo .getState () == DiskInfo .DiskState .OFFLINE ) {
632+ strBuffer .append (", disk " + diskInfo .getRootPath () + " is bad" );
633+ }
634+ }
635+ }
613636 strBuffer .append (", state=" );
614637 strBuffer .append (state .name ());
615638 strBuffer .append ("]" );
0 commit comments