mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 23:24:52 +09:00
Rework instance assigment process
Under the current system there's no distinction made on the slave side between instance config files that are present in the filesystem and instances actually assigned to the slave. Which could lead to problems with determing if an instance is actually assigned to the slave. Resolve this issue by separating discovered instances with assigned instances. Upon startup discovered instances are put into the discoveredInstanceInfos mapping on the Slave object and all of these are sent to the master server. The master server in turn sends assignment requests for all the instances which are assigned to the slave. These are put into the instanceInfos mapping of the Slave object which can then be relied up to include only assigned instances.
This commit is contained in:
1 parent
c78bf02ce4
commit
9d2ac2b81f
5 files changed
+142
-79
No files matched your search
+1
-2
@@ -152,8 +152,7 @@ describe("Slave testing", function() {
|
||||
it("should discover test instance", async function() {
|
||||
let logger = { log: () => {}, error: () => {} };
|
||||
let instancePath = path.join("test", "file", "instances");
|
||||
let instanceInfos = new Map();
|
||||
await slave._discoverInstances(instanceInfos, instancePath, logger);
|
||||
let instanceInfos = await slave._discoverInstances(instancePath, logger);
|
||||
|
||||
let referenceConfig = new libConfig.InstanceConfig();
|
||||
await referenceConfig.init();
|
||||
|
||||
Reference in new issue
Block a user