Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,13 @@ TabletScheduler 在每轮调度时,都会通过 LoadBalancer 来选择一定
`SHOW PROC '/dbs/29502391/29502428/partitions/29502427/29502428/29502553';`

```
+-----------+-----------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+------------+----------+----------+--------+-------+--------------+----------------------+
| ReplicaId | BackendId | Version | VersionHash | LstSuccessVersion | LstSuccessVersionHash | LstFailedVersion | LstFailedVersionHash | LstFailedTime | SchemaHash | DataSize | RowCount | State | IsBad | VersionCount | PathHash |
+-----------+-----------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+------------+----------+----------+--------+-------+--------------+----------------------+
| 43734060 | 10004 | 2 | 0 | -1 | 0 | -1 | 0 | N/A | -1 | 784 | 0 | NORMAL | false | 2 | -8566523878520798656 |
| 29502555 | 10002 | 2 | 0 | 2 | 0 | -1 | 0 | N/A | -1 | 784 | 0 | NORMAL | false | 2 | 1885826196444191611 |
| 39279319 | 10007 | 2 | 0 | -1 | 0 | -1 | 0 | N/A | -1 | 784 | 0 | NORMAL | false | 2 | 1656508631294397870 |
+-----------+-----------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+------------+----------+----------+--------+-------+--------------+----------------------+
+-----------+-----------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+------------+----------+----------+--------+-------+--------------+----------------------+----------+------------------+
| ReplicaId | BackendId | Version | VersionHash | LstSuccessVersion | LstSuccessVersionHash | LstFailedVersion | LstFailedVersionHash | LstFailedTime | SchemaHash | DataSize | RowCount | State | IsBad | VersionCount | PathHash | MetaUrl | CompactionStatus |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CompactionStatus --> compactionUrl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just make it be consistent with show tablet from tbl result.

+-----------+-----------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+------------+----------+----------+--------+-------+--------------+----------------------+----------+------------------+
| 43734060 | 10004 | 2 | 0 | -1 | 0 | -1 | 0 | N/A | -1 | 784 | 0 | NORMAL | false | 2 | -8566523878520798656 | url | url |
| 29502555 | 10002 | 2 | 0 | 2 | 0 | -1 | 0 | N/A | -1 | 784 | 0 | NORMAL | false | 2 | 1885826196444191611 | url | url |
| 39279319 | 10007 | 2 | 0 | -1 | 0 | -1 | 0 | N/A | -1 | 784 | 0 | NORMAL | false | 2 | 1656508631294397870 | url | url |
+-----------+-----------+---------+-------------+-------------------+-----------------------+------------------+----------------------+---------------+------------+----------+----------+--------+-------+--------------+----------------------+----------+------------------+
```

上图显示了对应 Tablet 的所有副本情况。这里显示的内容和 `SHOW TABLET FROM tbl1;` 的内容相同。但这里可以清楚的知道,一个具体的 Tablet 的所有副本的状态。
Expand Down
2 changes: 1 addition & 1 deletion fe/src/main/java/org/apache/doris/common/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public class Config extends ConfigBase {
* Master FE will save image every *edit_log_roll_num* meta journals.
*/
@ConfField(mutable = true, masterOnly = true)
public static int edit_log_roll_num = 50000
public static int edit_log_roll_num = 50000;

/**
* Non-master FE will stop offering service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@

package org.apache.doris.common.proc;

import org.apache.doris.catalog.Catalog;
import org.apache.doris.catalog.Replica;
import org.apache.doris.common.util.TimeUtils;
import org.apache.doris.system.Backend;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;

import java.util.Arrays;
import java.util.List;
Expand All @@ -35,21 +38,37 @@ public class ReplicasProcNode implements ProcNodeInterface {
.add("LstSuccessVersion").add("LstSuccessVersionHash")
.add("LstFailedVersion").add("LstFailedVersionHash")
.add("LstFailedTime").add("SchemaHash").add("DataSize").add("RowCount").add("State")
.add("IsBad").add("VersionCount").add("PathHash")
.add("IsBad").add("VersionCount").add("PathHash").add("MetaUrl").add("CompactionStatus")
.build();

private long tabletId;
private List<Replica> replicas;

public ReplicasProcNode(List<Replica> replicas) {
public ReplicasProcNode(long tabletId, List<Replica> replicas) {
this.tabletId = tabletId;
this.replicas = replicas;
}

@Override
public ProcResult fetchResult() {
ImmutableMap<Long, Backend> backendMap = Catalog.getCurrentSystemInfo().getIdToBackend();

BaseProcResult result = new BaseProcResult();
result.setNames(TITLE_NAMES);
for (Replica replica : replicas) {
String metaUrl = String.format("http://%s:%d/api/meta/header/%d/%d",
backendMap.get(replica.getBackendId()).getHost(),
backendMap.get(replica.getBackendId()).getHttpPort(),
tabletId,
replica.getSchemaHash());

String compactionUrl = String.format(
"http://%s:%d/api/compaction/show?tablet_id=%d&schema_hash=%d",
backendMap.get(replica.getBackendId()).getHost(),
backendMap.get(replica.getBackendId()).getHttpPort(),
tabletId,
replica.getSchemaHash());

result.addRow(Arrays.asList(String.valueOf(replica.getId()),
String.valueOf(replica.getBackendId()),
String.valueOf(replica.getVersion()),
Expand All @@ -65,7 +84,9 @@ public ProcResult fetchResult() {
String.valueOf(replica.getState()),
String.valueOf(replica.isBad()),
String.valueOf(replica.getVersionCount()),
String.valueOf(replica.getPathHash())));
String.valueOf(replica.getPathHash()),
metaUrl,
compactionUrl));
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ public ProcNodeInterface lookup(String tabletIdStr) throws AnalysisException {

TabletInvertedIndex invertedIndex = Catalog.getCurrentInvertedIndex();
List<Replica> replicas = invertedIndex.getReplicasByTabletId(tabletId);
return new ReplicasProcNode(replicas);
return new ReplicasProcNode(tabletId, replicas);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public ProcNodeInterface lookup(String tabletIdStr) throws AnalysisException {

TabletInvertedIndex invertedIndex = Catalog.getCurrentInvertedIndex();
List<Replica> replicas = invertedIndex.getReplicasByTabletId(tabletId);
return new ReplicasProcNode(replicas);
return new ReplicasProcNode(tabletId, replicas);
}

public static int analyzeColumn(String columnName) throws AnalysisException {
Expand Down
2 changes: 1 addition & 1 deletion fe/src/test/java/org/apache/doris/metric/MetricsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static void setUp() {
@Test
public void testTcpMetrics() {
List<Metric> metrics = MetricRepo.getMetricsByName("snmp");
Assert.assertEquals(2, metrics.size());
Assert.assertEquals(4, metrics.size());
for (Metric metric : metrics) {
GaugeMetric<Long> gm = (GaugeMetric<Long>) metric;
if (gm.getLabels().get(0).getValue().equals("tcp_retrans_segs")) {
Expand Down