Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](cloud version) fix version of information_schema table backward when query in follower node #43451

Merged
merged 1 commit into from
Nov 8, 2024
Merged
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 @@ -45,6 +45,7 @@
import org.apache.doris.catalog.TableIf.TableType;
import org.apache.doris.catalog.Tablet;
import org.apache.doris.catalog.TabletMeta;
import org.apache.doris.cloud.catalog.CloudPartition;
import org.apache.doris.cloud.catalog.CloudTablet;
import org.apache.doris.cloud.proto.Cloud.CommitTxnResponse;
import org.apache.doris.cluster.ClusterNamespace;
Expand Down Expand Up @@ -623,6 +624,20 @@ public TListTableStatusResult listTableStatus(TGetTablesParams params) throws TE
table.getName(), PrivPredicate.SHOW)) {
continue;
}
// For the follower node in cloud mode,
// when querying the information_schema table,
// the version needs to be updated.
// Otherwise, the version will always be the old value
// unless there is a query for the table in the follower node.
if (!Env.getCurrentEnv().isMaster() && Config.isCloudMode()
&& table instanceof OlapTable) {
OlapTable olapTable = (OlapTable) table;
List<CloudPartition> partitions = olapTable.getAllPartitions().stream()
.filter(p -> p instanceof CloudPartition)
.map(cloudPartition -> (CloudPartition) cloudPartition)
.collect(Collectors.toList());
CloudPartition.getSnapshotVisibleVersion(partitions);
}
table.readLock();
try {
if (matcher != null && !matcher.match(table.getName())) {
Expand Down
Loading