[bug](group_commit) fix relay wal problem on materialized-view (#29848)

This commit is contained in:
huanghaibin
2024-01-11 19:56:47 +08:00
committed by yiguolei
parent a4f29193f6
commit cbffdbb8bf
4 changed files with 10 additions and 4 deletions

View File

@ -607,7 +607,7 @@ public class SchemaChangeJobV2 extends AlterJobV2 {
List<Long> aliveBeIds = Env.getCurrentSystemInfo().getAllBackendIds(true);
long expireTime = System.currentTimeMillis() + Config.check_wal_queue_timeout_threshold;
while (true) {
LOG.info("wai for wal queue size to be empty");
LOG.info("wait for wal queue size to be empty");
boolean walFinished = Env.getCurrentEnv().getGroupCommitManager()
.isPreviousWalFinished(tableId, aliveBeIds);
if (walFinished) {

View File

@ -333,7 +333,12 @@ public class LoadAction extends RestBaseController {
.setEnableRoundRobin(true)
.needLoadAvailable().build();
policy.nextRoundRobinIndex = getLastSelectedBackendIndexAndUpdate();
List<Long> backendIds = Env.getCurrentSystemInfo().selectBackendIdsByPolicy(policy, 1);
List<Long> backendIds;
if (groupCommit) {
backendIds = Env.getCurrentSystemInfo().selectBackendIdsByPolicy(policy, -1);
} else {
backendIds = Env.getCurrentSystemInfo().selectBackendIdsByPolicy(policy, 1);
}
if (backendIds.isEmpty()) {
throw new LoadException(SystemInfoService.NO_BACKEND_LOAD_AVAILABLE_MSG + ", policy: " + policy);
}