You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/08/10 12:09:23 UTC

[GitHub] [incubator-doris] xy720 opened a new pull request #6418: [Enhance] Reduce thread number of SyncJob to save resources

xy720 opened a new pull request #6418:
URL: https://github.com/apache/incubator-doris/pull/6418


   ## Proposed changes
   
   #6417 
   
   This commit is going to reduce thread number of SyncJob .
   1、Submit send task to thread pool to send data.
   2、Submit eof task to thread pool to block and wake up client to commit one txn.
   3、Use ScripedTaskExecutor to ensure correct order of sent data in every channel.
   
   ## Types of changes
   
   What types of changes does your code introduce to Doris?
   _Put an `x` in the boxes that apply_
   
   - [x] Optimization. Including functional usability improvements and performance improvements.
   
   
   ## Checklist
   
   _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
   
   - [x] I have created an issue on (Fix #6417 ) and described the bug/feature there in detail
   
   ## 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...
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] xy720 commented on a change in pull request #6418: [Enhance] [Binlog] Reduce thread number of SyncJob to save resources

Posted by GitBox <gi...@apache.org>.
xy720 commented on a change in pull request #6418:
URL: https://github.com/apache/incubator-doris/pull/6418#discussion_r698993299



##########
File path: fe/fe-core/src/main/java/org/apache/doris/task/SyncTask.java
##########
@@ -0,0 +1,58 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.task;
+
+import org.apache.doris.load.sync.SyncChannelCallback;
+import org.apache.doris.task.SerialExecutorService.SerialRunnable;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public abstract class SyncTask implements SerialRunnable {
+    private static final Logger LOG = LogManager.getLogger(SyncTask.class);
+
+    protected long signature;
+    protected int index;

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #6418: [Enhance] [Binlog] Reduce thread number of SyncJob to save resources

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #6418:
URL: https://github.com/apache/incubator-doris/pull/6418#issuecomment-917648133






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] xy720 commented on a change in pull request #6418: [Enhance] [Binlog] Reduce thread number of SyncJob to save resources

Posted by GitBox <gi...@apache.org>.
xy720 commented on a change in pull request #6418:
URL: https://github.com/apache/incubator-doris/pull/6418#discussion_r698993519



##########
File path: fe/fe-core/src/main/java/org/apache/doris/task/SerialExecutorService.java
##########
@@ -0,0 +1,80 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.task;
+
+import org.apache.doris.common.ThreadPoolManager;
+
+import java.util.concurrent.ExecutorService;
+
+/**
+ * This executor service ensures that all tasks submitted to
+ * the same slot are executed in the order of submission.
+ */
+public class SerialExecutorService {
+
+    public interface SerialRunnable extends Runnable {
+        int getIndex();
+    }
+
+    private final int numOfSlots;
+    private final ExecutorService taskPool;
+    private final SerialExecutor[] slots;
+
+    private SerialExecutorService(int numOfSlots, ExecutorService taskPool) {
+        this.numOfSlots = numOfSlots;
+        this.slots = new SerialExecutor[numOfSlots];
+        this.taskPool = taskPool;
+        for (int i = 0; i < numOfSlots; i++) {
+            slots[i] = new SerialExecutor(taskPool);
+        }
+    }
+
+    public SerialExecutorService(int numOfSlots) {
+        this(numOfSlots, ThreadPoolManager.newDaemonFixedThreadPool(
+                numOfSlots, 256, "sync-task-pool", true));
+    }
+
+    public void submit(Runnable command) {
+        int index = getIndex(command);
+        if (isSlotIndex(index)) {
+            SerialExecutor serialEx = slots[index];
+            serialEx.execute(command);
+        } else {
+            taskPool.execute(command);

Review comment:
       It‘s for compatibility with general thread pools

##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/ChannelDescription.java
##########
@@ -60,6 +60,8 @@
     // column names of source table
     @SerializedName(value = "colNames")
     private final List<String> colNames;
+    @SerializedName(value = "id")

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman merged pull request #6418: [Enhance] [Binlog] Reduce thread number of SyncJob to save resources

Posted by GitBox <gi...@apache.org>.
morningman merged pull request #6418:
URL: https://github.com/apache/incubator-doris/pull/6418


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on a change in pull request #6418: [Enhance] [Binlog] Reduce thread number of SyncJob to save resources

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #6418:
URL: https://github.com/apache/incubator-doris/pull/6418#discussion_r698919562



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/ChannelDescription.java
##########
@@ -60,6 +60,8 @@
     // column names of source table
     @SerializedName(value = "colNames")
     private final List<String> colNames;
+    @SerializedName(value = "id")

Review comment:
       use same name as variables

##########
File path: fe/fe-core/src/main/java/org/apache/doris/task/SerialExecutorService.java
##########
@@ -0,0 +1,80 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.task;
+
+import org.apache.doris.common.ThreadPoolManager;
+
+import java.util.concurrent.ExecutorService;
+
+/**
+ * This executor service ensures that all tasks submitted to
+ * the same slot are executed in the order of submission.
+ */
+public class SerialExecutorService {
+
+    public interface SerialRunnable extends Runnable {
+        int getIndex();
+    }
+
+    private final int numOfSlots;
+    private final ExecutorService taskPool;
+    private final SerialExecutor[] slots;
+
+    private SerialExecutorService(int numOfSlots, ExecutorService taskPool) {
+        this.numOfSlots = numOfSlots;
+        this.slots = new SerialExecutor[numOfSlots];
+        this.taskPool = taskPool;
+        for (int i = 0; i < numOfSlots; i++) {
+            slots[i] = new SerialExecutor(taskPool);
+        }
+    }
+
+    public SerialExecutorService(int numOfSlots) {
+        this(numOfSlots, ThreadPoolManager.newDaemonFixedThreadPool(
+                numOfSlots, 256, "sync-task-pool", true));
+    }
+
+    public void submit(Runnable command) {
+        int index = getIndex(command);
+        if (isSlotIndex(index)) {
+            SerialExecutor serialEx = slots[index];
+            serialEx.execute(command);
+        } else {
+            taskPool.execute(command);

Review comment:
       Do we need to accept task without index in this pool?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/task/SyncTask.java
##########
@@ -0,0 +1,58 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.task;
+
+import org.apache.doris.load.sync.SyncChannelCallback;
+import org.apache.doris.task.SerialExecutorService.SerialRunnable;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public abstract class SyncTask implements SerialRunnable {
+    private static final Logger LOG = LogManager.getLogger(SyncTask.class);
+
+    protected long signature;
+    protected int index;

Review comment:
       Add comment to explain the `index`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on a change in pull request #6418: [Enhance] [Binlog] Reduce thread number of SyncJob to save resources

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #6418:
URL: https://github.com/apache/incubator-doris/pull/6418#discussion_r693643406



##########
File path: fe/fe-core/src/main/java/org/apache/doris/task/SyncTaskPool.java
##########
@@ -0,0 +1,35 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.task;
+
+import java.util.concurrent.ExecutorService;
+
+public class SyncTaskPool {
+
+    private static final ExecutorService executor = new StripedTaskExecutor();
+
+    public SyncTaskPool() {

Review comment:
       Useless

##########
File path: fe/fe-core/src/main/java/org/apache/doris/common/Config.java
##########
@@ -634,6 +634,11 @@
      */
     @ConfField public static int sync_checker_interval_second = 5;
 
+    /**
+     * max num of thread to handle sync task in sync task thread-pool.
+     */
+    @ConfField public static int max_sync_task_threads_num = 1024;

Review comment:
       Why need so many threads here?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on a change in pull request #6418: [Enhance] [Binlog] Reduce thread number of SyncJob to save resources

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #6418:
URL: https://github.com/apache/incubator-doris/pull/6418#discussion_r698919562



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/ChannelDescription.java
##########
@@ -60,6 +60,8 @@
     // column names of source table
     @SerializedName(value = "colNames")
     private final List<String> colNames;
+    @SerializedName(value = "id")

Review comment:
       use same name as variables

##########
File path: fe/fe-core/src/main/java/org/apache/doris/task/SerialExecutorService.java
##########
@@ -0,0 +1,80 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.task;
+
+import org.apache.doris.common.ThreadPoolManager;
+
+import java.util.concurrent.ExecutorService;
+
+/**
+ * This executor service ensures that all tasks submitted to
+ * the same slot are executed in the order of submission.
+ */
+public class SerialExecutorService {
+
+    public interface SerialRunnable extends Runnable {
+        int getIndex();
+    }
+
+    private final int numOfSlots;
+    private final ExecutorService taskPool;
+    private final SerialExecutor[] slots;
+
+    private SerialExecutorService(int numOfSlots, ExecutorService taskPool) {
+        this.numOfSlots = numOfSlots;
+        this.slots = new SerialExecutor[numOfSlots];
+        this.taskPool = taskPool;
+        for (int i = 0; i < numOfSlots; i++) {
+            slots[i] = new SerialExecutor(taskPool);
+        }
+    }
+
+    public SerialExecutorService(int numOfSlots) {
+        this(numOfSlots, ThreadPoolManager.newDaemonFixedThreadPool(
+                numOfSlots, 256, "sync-task-pool", true));
+    }
+
+    public void submit(Runnable command) {
+        int index = getIndex(command);
+        if (isSlotIndex(index)) {
+            SerialExecutor serialEx = slots[index];
+            serialEx.execute(command);
+        } else {
+            taskPool.execute(command);

Review comment:
       Do we need to accept task without index in this pool?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/task/SyncTask.java
##########
@@ -0,0 +1,58 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.task;
+
+import org.apache.doris.load.sync.SyncChannelCallback;
+import org.apache.doris.task.SerialExecutorService.SerialRunnable;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public abstract class SyncTask implements SerialRunnable {
+    private static final Logger LOG = LogManager.getLogger(SyncTask.class);
+
+    protected long signature;
+    protected int index;

Review comment:
       Add comment to explain the `index`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] xy720 commented on a change in pull request #6418: [Enhance] [Binlog] Reduce thread number of SyncJob to save resources

Posted by GitBox <gi...@apache.org>.
xy720 commented on a change in pull request #6418:
URL: https://github.com/apache/incubator-doris/pull/6418#discussion_r698446514



##########
File path: fe/fe-core/src/main/java/org/apache/doris/task/SyncTaskPool.java
##########
@@ -0,0 +1,35 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.task;
+
+import java.util.concurrent.ExecutorService;
+
+public class SyncTaskPool {
+
+    private static final ExecutorService executor = new StripedTaskExecutor();
+
+    public SyncTaskPool() {

Review comment:
       Fixed

##########
File path: fe/fe-core/src/main/java/org/apache/doris/common/Config.java
##########
@@ -634,6 +634,11 @@
      */
     @ConfField public static int sync_checker_interval_second = 5;
 
+    /**
+     * max num of thread to handle sync task in sync task thread-pool.
+     */
+    @ConfField public static int max_sync_task_threads_num = 1024;

Review comment:
       Now is 10.

##########
File path: fe/fe-core/src/main/java/org/apache/doris/task/SyncTask.java
##########
@@ -0,0 +1,58 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.task;
+
+import org.apache.doris.load.sync.SyncChannelCallback;
+import org.apache.doris.task.SerialExecutorService.SerialRunnable;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public abstract class SyncTask implements SerialRunnable {
+    private static final Logger LOG = LogManager.getLogger(SyncTask.class);
+
+    protected long signature;
+    protected int index;

Review comment:
       done

##########
File path: fe/fe-core/src/main/java/org/apache/doris/task/SerialExecutorService.java
##########
@@ -0,0 +1,80 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.task;
+
+import org.apache.doris.common.ThreadPoolManager;
+
+import java.util.concurrent.ExecutorService;
+
+/**
+ * This executor service ensures that all tasks submitted to
+ * the same slot are executed in the order of submission.
+ */
+public class SerialExecutorService {
+
+    public interface SerialRunnable extends Runnable {
+        int getIndex();
+    }
+
+    private final int numOfSlots;
+    private final ExecutorService taskPool;
+    private final SerialExecutor[] slots;
+
+    private SerialExecutorService(int numOfSlots, ExecutorService taskPool) {
+        this.numOfSlots = numOfSlots;
+        this.slots = new SerialExecutor[numOfSlots];
+        this.taskPool = taskPool;
+        for (int i = 0; i < numOfSlots; i++) {
+            slots[i] = new SerialExecutor(taskPool);
+        }
+    }
+
+    public SerialExecutorService(int numOfSlots) {
+        this(numOfSlots, ThreadPoolManager.newDaemonFixedThreadPool(
+                numOfSlots, 256, "sync-task-pool", true));
+    }
+
+    public void submit(Runnable command) {
+        int index = getIndex(command);
+        if (isSlotIndex(index)) {
+            SerialExecutor serialEx = slots[index];
+            serialEx.execute(command);
+        } else {
+            taskPool.execute(command);

Review comment:
       It‘s for compatibility with general thread pools

##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/ChannelDescription.java
##########
@@ -60,6 +60,8 @@
     // column names of source table
     @SerializedName(value = "colNames")
     private final List<String> colNames;
+    @SerializedName(value = "id")

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] xy720 commented on a change in pull request #6418: [Enhance] [Binlog] Reduce thread number of SyncJob to save resources

Posted by GitBox <gi...@apache.org>.
xy720 commented on a change in pull request #6418:
URL: https://github.com/apache/incubator-doris/pull/6418#discussion_r698446514



##########
File path: fe/fe-core/src/main/java/org/apache/doris/task/SyncTaskPool.java
##########
@@ -0,0 +1,35 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.task;
+
+import java.util.concurrent.ExecutorService;
+
+public class SyncTaskPool {
+
+    private static final ExecutorService executor = new StripedTaskExecutor();
+
+    public SyncTaskPool() {

Review comment:
       Fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] xy720 commented on a change in pull request #6418: [Enhance] [Binlog] Reduce thread number of SyncJob to save resources

Posted by GitBox <gi...@apache.org>.
xy720 commented on a change in pull request #6418:
URL: https://github.com/apache/incubator-doris/pull/6418#discussion_r698446705



##########
File path: fe/fe-core/src/main/java/org/apache/doris/common/Config.java
##########
@@ -634,6 +634,11 @@
      */
     @ConfField public static int sync_checker_interval_second = 5;
 
+    /**
+     * max num of thread to handle sync task in sync task thread-pool.
+     */
+    @ConfField public static int max_sync_task_threads_num = 1024;

Review comment:
       Now is 10.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org