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

[BugFix] ignore star mgr's OP_STARMGR journal write only in submitLog #45933

Merged
merged 1 commit into from
May 21, 2024
Merged
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
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
Loading