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 bug of routine load job #1116

Merged
merged 2 commits into from
May 9, 2019
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion fe/src/main/java/org/apache/doris/load/loadv2/LoadJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.apache.doris.common.LabelAlreadyUsedException;
import org.apache.doris.common.MetaNotFoundException;
import org.apache.doris.common.UserException;
import org.apache.doris.common.util.DebugUtil;
import org.apache.doris.common.util.LogBuilder;
import org.apache.doris.common.util.LogKey;
import org.apache.doris.common.util.TimeUtils;
Expand Down Expand Up @@ -221,7 +222,7 @@ public void beginTxn() throws LabelAlreadyUsedException, BeginTransactionExcepti
// register txn state listener
Catalog.getCurrentGlobalTransactionMgr().getCallbackFactory().addCallback(this);
transactionId = Catalog.getCurrentGlobalTransactionMgr()
.beginTransaction(dbId, label, -1, "FE: " + FrontendOptions.getLocalHostAddress(),
.beginTransaction(dbId, String.valueOf(id), -1, "FE: " + FrontendOptions.getLocalHostAddress(),
TransactionState.LoadJobSourceType.FRONTEND, id,
timeoutSecond - 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,13 @@ public void addTasksInQueue(List<RoutineLoadTaskInfo> routineLoadTaskInfoList) {
private void submitBatchTasksIfNotEmpty(Map<Long, List<TRoutineLoadTask>> beIdToRoutineLoadTask) {
for (Map.Entry<Long, List<TRoutineLoadTask>> entry : beIdToRoutineLoadTask.entrySet()) {
Backend backend = Catalog.getCurrentSystemInfo().getBackend(entry.getKey());
if (backend == null) {
LOG.warn("failed to send tasks to be {} when backend is unavailable", entry.getKey());
continue;
}
TNetworkAddress address = new TNetworkAddress(backend.getHost(), backend.getBePort());
BackendService.Client client = null;
boolean ok = false;
BackendService.Client client = null;
try {
client = ClientPool.backendPool.borrowObject(address);
client.submit_routine_load_task(entry.getValue());
Expand All @@ -194,7 +198,7 @@ private void submitBatchTasksIfNotEmpty(Map<Long, List<TRoutineLoadTask>> beIdTo
ok = true;
entry.getValue().clear();
} catch (Exception e) {
LOG.warn("task send error. backend[{}]", backend.getId(), e);
LOG.warn("task send error. backend[{}]", entry.getKey(), e);
} finally {
if (ok) {
ClientPool.backendPool.returnObject(address, client);
Expand Down