[Doris On ES][Bug-fix] Sync ES metadata failure after restart or upgrade FE (#3961)

ISSUE:#3960
PR #3454 introduce the caching for EsClient, but the initialization of the client was only during editlog replay, all this work should done also during image replay.

This happens when restart or upgrade FE

BTW: modify a UT failure for metric
This commit is contained in:
Yunfeng,Wu
2020-06-29 14:13:07 +08:00
committed by GitHub
parent 55c058e4b1
commit d82d48da87
2 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ public class EsRepository extends MasterDaemon {
List<Table> tables = database.getTables();
for (Table table : tables) {
if (table.getType() == TableType.ELASTICSEARCH) {
esTables.put(table.getId(), (EsTable) table);
registerTable((EsTable) table);
}
}
}

View File

@ -36,7 +36,7 @@ public class MetricsTest {
@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")) {