Skip to content

Commit

Permalink
[BugFix] ignore star mgr's OP_STARMGR journal write only in `submitLo…
Browse files Browse the repository at this point in the history
…g` (#45933)

Signed-off-by: starrocks-xupeng <[email protected]>
  • Loading branch information
starrocks-xupeng authored May 21, 2024
1 parent a2460eb commit 95b551d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fe/fe-core/src/main/java/com/starrocks/persist/EditLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
import com.starrocks.scheduler.persist.TaskRunStatusChange;
import com.starrocks.server.GlobalStateMgr;
import com.starrocks.server.LocalMetastore;
import com.starrocks.server.RunMode;
import com.starrocks.sql.ast.UserIdentity;
import com.starrocks.staros.StarMgrJournal;
import com.starrocks.staros.StarMgrServer;
Expand Down Expand Up @@ -1242,11 +1241,10 @@ protected void logEdit(short op, Writable writable) {
*/
private JournalTask submitLog(short op, Writable writable, long maxWaitIntervalMs) {
long startTimeNano = System.nanoTime();
// do not check whether global state mgr is leader in non shared-nothing mode,
// do not check whether global state mgr is leader when writing star mgr journal,
// because starmgr state change happens before global state mgr state change,
// it will write log before global state mgr becomes leader
Preconditions.checkState(RunMode.getCurrentRunMode() != RunMode.SHARED_NOTHING ||
GlobalStateMgr.getCurrentState().isLeader(),
Preconditions.checkState(op == OperationType.OP_STARMGR || GlobalStateMgr.getCurrentState().isLeader(),
"Current node is not leader, but " +
GlobalStateMgr.getCurrentState().getFeType() + ", submit log is not allowed");
DataOutputBuffer buffer = new DataOutputBuffer(OUTPUT_BUFFER_INIT_SIZE);
Expand Down

0 comments on commit 95b551d

Please sign in to comment.