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

[Enhancement] Trigger new starmgr image in alter system create image for shared-data mode (backport #54370) #54389

Merged
merged 2 commits into from
Dec 27, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
import com.starrocks.sql.ast.ModifyBackendClause;
import com.starrocks.sql.ast.ModifyBrokerClause;
import com.starrocks.sql.ast.ModifyFrontendAddressClause;
import com.starrocks.staros.StarMgrServer;
import com.starrocks.system.Backend;
import com.starrocks.system.SystemInfoService;
import org.apache.commons.lang.NotImplementedException;
Expand Down Expand Up @@ -204,6 +205,9 @@ public synchronized ShowResultSet process(List<AlterClause> alterClauses, Databa
GlobalStateMgr.getCurrentSystemInfo().dropComputeNodes(dropComputeNodeClause.getHostPortPairs());
} else if (alterClause instanceof CreateImageClause) {
GlobalStateMgr.getCurrentState().triggerNewImage();
if (RunMode.isSharedDataMode()) {
StarMgrServer.getCurrentState().triggerNewImage();
}
} else if (alterClause instanceof CleanTabletSchedQClause) {
GlobalStateMgr.getCurrentState().getTabletScheduler().forceCleanSchedQ();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,9 @@ private boolean replayJournal(JournalCursor cursor)
public BDBJEJournal getJournal() {
return bdbjeJournal;
}

public JournalWriter getJournalWriter() {
return journalWriter;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,8 @@ public long getMaxJournalId() {
public long getReplayId() {
return getJournalSystem().getReplayId();
}

public void triggerNewImage() {
journalSystem.getJournalWriter().setForceRollJournal();
}
}
Loading