|
45 | 45 | import org.apache.doris.catalog.TableIf.TableType;
|
46 | 46 | import org.apache.doris.catalog.Tablet;
|
47 | 47 | import org.apache.doris.catalog.TabletMeta;
|
| 48 | +import org.apache.doris.cloud.catalog.CloudPartition; |
48 | 49 | import org.apache.doris.cloud.catalog.CloudTablet;
|
49 | 50 | import org.apache.doris.cloud.proto.Cloud.CommitTxnResponse;
|
50 | 51 | import org.apache.doris.cluster.ClusterNamespace;
|
@@ -623,6 +624,20 @@ public TListTableStatusResult listTableStatus(TGetTablesParams params) throws TE
|
623 | 624 | table.getName(), PrivPredicate.SHOW)) {
|
624 | 625 | continue;
|
625 | 626 | }
|
| 627 | + // For the follower node in cloud mode, |
| 628 | + // when querying the information_schema table, |
| 629 | + // the version needs to be updated. |
| 630 | + // Otherwise, the version will always be the old value |
| 631 | + // unless there is a query for the table in the follower node. |
| 632 | + if (!Env.getCurrentEnv().isMaster() && Config.isCloudMode() |
| 633 | + && table instanceof OlapTable) { |
| 634 | + OlapTable olapTable = (OlapTable) table; |
| 635 | + List<CloudPartition> partitions = olapTable.getAllPartitions().stream() |
| 636 | + .filter(p -> p instanceof CloudPartition) |
| 637 | + .map(cloudPartition -> (CloudPartition) cloudPartition) |
| 638 | + .collect(Collectors.toList()); |
| 639 | + CloudPartition.getSnapshotVisibleVersion(partitions); |
| 640 | + } |
626 | 641 | table.readLock();
|
627 | 642 | try {
|
628 | 643 | if (matcher != null && !matcher.match(table.getName())) {
|
|
0 commit comments