[enhancement](session-variable)add a use_fix_replica session variable to fix query replica#17101
[enhancement](session-variable)add a use_fix_replica session variable to fix query replica#17101yiguolei merged 3 commits intoapache:masterfrom
Conversation
|
|
||
| public static final String MAX_TABLE_COUNT_USE_CASCADES_JOIN_REORDER = "max_table_count_use_cascades_join_reorder"; | ||
|
|
||
| // fix replic to query. If num = 1, query the smallest replic, if 2 is the second smallest replic. |
There was a problem hiding this comment.
typo error replic ---> replica
| Collections.shuffle(replicas); | ||
| } else { | ||
| LOG.debug("use fix replica, value: {}, replica num: {}", useFixReplica, replicas.size()); | ||
| // sort by replica id |
There was a problem hiding this comment.
the logic is too complicated!!!
if (useFixReplica == -1) {
Collections.shuffle(replicas);
} else {
LOG.debug("use fix replica, value: {}, replica num: {}", useFixReplica, replicas.size());
// sort by replica id
replicas.sort(Replica.ID_COMPARATOR);
Replica replica = replicas.get(useFixReplica >= replicas.size() : replicas.size() - 1 ? useFixReplica);
replicas.clear();
replicas.add(replica);
}
Then other code does not need change.
|
run buildall |
|
TeamCity pipeline, clickbench performance test result: |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
… to fix query replica (apache#17101) Add use_fix_replica session variable, so that we can be better debug replica inconsistencies problem. If use_fix_replica default is -1, which means not fix, else we will choose the {use_fix_replica} smallest replica.
… to fix query replica (apache#17101) Add use_fix_replica session variable, so that we can be better debug replica inconsistencies problem. If use_fix_replica default is -1, which means not fix, else we will choose the {use_fix_replica} smallest replica.
Proposed changes
Issue Number: close #xxx
Problem summary
Add
use_fix_replicasession variable, so that we can be better debug replica inconsistencies problem.If
use_fix_replicadefault is -1, which means not fix,else we will choose the {
use_fix_replica} smallest replica.Checklist(Required)
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...