Skip to content

Commit

Permalink
[fix](publish) publish go ahead even if quorum is not met (apache#23806)
Browse files Browse the repository at this point in the history

Co-authored-by: Yongqiang YANG <[email protected]>
  • Loading branch information
yujun777 and dataroaring authored Sep 12, 2023
1 parent 2e2e174 commit 9e0d843
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,13 @@ public class Config extends ConfigBase {
"Maximal waiting time for all publish version tasks of one transaction to be finished, in seconds."})
public static int publish_version_timeout_second = 30; // 30 seconds

@ConfField(mutable = true, masterOnly = true, description = {"导入 Publish 阶段的等待时间,单位是秒。超过此时间,"
+ "则只需每个tablet包含一个成功副本,则导入成功。值为 -1 时,表示无限等待。",
"Waiting time for one transaction changing to \"at least one replica success\", in seconds."
+ "If time exceeds this, and for each tablet it has at least one replica publish successful, "
+ "then the load task will be successful." })
public static int publish_wait_time_second = 300;

@ConfField(mutable = true, masterOnly = true, description = {"提交事务的最大超时时间,单位是秒。"
+ "该参数仅用于事务型 insert 操作中。",
"Maximal waiting time for all data inserted before one transaction to be committed, in seconds. "
Expand Down
26 changes: 26 additions & 0 deletions fe/fe-core/src/main/java/org/apache/doris/catalog/Replica.java
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,32 @@ public String toString() {
return strBuffer.toString();
}

public String toStringSimple(boolean checkBeAlive) {
StringBuilder strBuffer = new StringBuilder("[replicaId=");
strBuffer.append(id);
strBuffer.append(", backendId=");
strBuffer.append(backendId);
if (checkBeAlive) {
strBuffer.append(", backendAlive=");
strBuffer.append(Env.getCurrentSystemInfo().checkBackendAlive(backendId));
}
strBuffer.append(", version=");
strBuffer.append(version);
if (lastFailedVersion > 0) {
strBuffer.append(", lastFailedVersion=");
strBuffer.append(lastFailedVersion);
strBuffer.append(", lastSuccessVersion=");
strBuffer.append(lastSuccessVersion);
strBuffer.append(", lastFailedTimestamp=");
strBuffer.append(lastFailedTimestamp);
}
strBuffer.append(", state=");
strBuffer.append(state.name());
strBuffer.append("]");

return strBuffer.toString();
}

@Override
public void write(DataOutput out) throws IOException {
out.writeLong(id);
Expand Down
Loading

0 comments on commit 9e0d843

Please sign in to comment.