-
Notifications
You must be signed in to change notification settings - Fork 614
fix(server): fix the scheduler and the scheduler selection logic #2937
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
base: master
Are you sure you want to change the base?
Changes from all commits
fc2ec66
14ff01b
3df586e
e5a4e09
6cb7e8c
9a2f879
39d9467
f0fbc4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -176,7 +176,6 @@ public class StandardHugeGraph implements HugeGraph { | |
| private final BackendStoreProvider storeProvider; | ||
| private final TinkerPopTransaction tx; | ||
| private final RamTable ramtable; | ||
| private final String schedulerType; | ||
| private volatile boolean started; | ||
| private volatile boolean closed; | ||
| private volatile GraphMode mode; | ||
|
|
@@ -229,7 +228,6 @@ public StandardHugeGraph(HugeConfig config) { | |
| this.closed = false; | ||
| this.mode = GraphMode.NONE; | ||
| this.readMode = GraphReadMode.OLTP_ONLY; | ||
| this.schedulerType = config.get(CoreOptions.SCHEDULER_TYPE); | ||
|
|
||
| LockUtil.init(this.spaceGraphName()); | ||
|
|
||
|
|
@@ -315,6 +313,7 @@ public String backend() { | |
| return this.storeProvider.type(); | ||
| } | ||
|
|
||
| @Override | ||
| public BackendStoreInfo backendStoreInfo() { | ||
| // Just for trigger Tx.getOrNewTransaction, then load 3 stores | ||
| // TODO: pass storeProvider.metaStore() | ||
|
|
@@ -332,11 +331,10 @@ public void serverStarted(GlobalMasterInfo nodeInfo) { | |
| LOG.info("Init system info for graph '{}'", this.spaceGraphName()); | ||
| this.initSystemInfo(); | ||
|
|
||
| LOG.info("Init server info [{}-{}] for graph '{}'...", | ||
| nodeInfo.nodeId(), nodeInfo.nodeRole(), this.spaceGraphName()); | ||
| this.serverInfoManager().initServerInfo(nodeInfo); | ||
|
|
||
| this.initRoleStateMachine(nodeInfo.nodeId()); | ||
| if (nodeInfo != null && nodeInfo.nodeId() != null) { | ||
| this.serverInfoManager().initServerInfo(nodeInfo); | ||
| this.initRoleStateMachine(nodeInfo.nodeId()); | ||
| } | ||
|
|
||
| // TODO: check necessary? | ||
| LOG.info("Check olap property-key tables for graph '{}'", this.spaceGraphName()); | ||
|
|
@@ -465,6 +463,7 @@ public void updateTime(Date updateTime) { | |
| this.updateTime = updateTime; | ||
| } | ||
|
|
||
| @Override | ||
| public void waitStarted() { | ||
| // Just for trigger Tx.getOrNewTransaction, then load 3 stores | ||
| this.schemaTransaction(); | ||
|
|
@@ -481,9 +480,7 @@ public void initBackend() { | |
| try { | ||
| this.storeProvider.init(); | ||
| /* | ||
| * NOTE: The main goal is to write the serverInfo to the central | ||
| * node, such as etcd, and also create the system schema in memory, | ||
| * which has no side effects | ||
| * NOTE: Create system schema in memory, which has no side effects. | ||
| */ | ||
| this.initSystemInfo(); | ||
| } finally { | ||
|
|
@@ -524,8 +521,7 @@ public void truncateBackend() { | |
| LockUtil.lock(this.spaceGraphName(), LockUtil.GRAPH_LOCK); | ||
| try { | ||
| this.storeProvider.truncate(); | ||
| // TODO: remove this after serverinfo saved in etcd | ||
| this.serverStarted(this.serverInfoManager().globalNodeRoleInfo()); | ||
| this.serverStarted(null); | ||
| } finally { | ||
| LockUtil.unlock(this.spaceGraphName(), LockUtil.GRAPH_LOCK); | ||
| } | ||
|
|
@@ -547,7 +543,6 @@ public KvStore kvStore() { | |
| public void initSystemInfo() { | ||
| try { | ||
| this.taskScheduler().init(); | ||
| this.serverInfoManager().init(); | ||
| this.authManager().init(); | ||
| } finally { | ||
| this.closeTx(); | ||
|
|
@@ -1632,7 +1627,9 @@ public <T> void submitEphemeralJob(EphemeralJob<T> job) { | |
|
|
||
| @Override | ||
| public String schedulerType() { | ||
| return StandardHugeGraph.this.schedulerType; | ||
| // Use distributed scheduler for hstore backend, otherwise use local | ||
| // After the merger of rocksdb and hstore, consider whether to change this logic | ||
| return StandardHugeGraph.this.isHstore() ? "distributed" : "local"; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.