Write instances to the new instance path, as well as to the old
@@ -74,6 +74,7 @@ public class CuratorDb {
private static final Path lockRoot = root.append("locks");
private static final Path tenantRoot = root.append("tenants");
private static final Path applicationRoot = root.append("applications");
+ private static final Path instanceRoot = root.append("instances");
private static final Path jobRoot = root.append("jobs");
private static final Path controllerRoot = root.append("controllers");
private static final Path routingPoliciesRoot = root.append("routingPolicies");
@@ -334,6 +335,7 @@ public class CuratorDb {
public void writeInstance(Instance instance) {
curator.set(applicationPath(instance.id()), asJson(instanceSerializer.toSlime(instance)));
+ curator.set(instancePath(instance.id()), asJson(instanceSerializer.toSlime(instance)));
}
public Optional<Instance> readInstance(ApplicationId application) {
@@ -362,6 +364,7 @@ public class CuratorDb {
public void removeInstance(ApplicationId id) {
curator.delete(applicationPath(id));
+ curator.delete(instancePath(id));
}
// -------------- Job Runs ------------------------------------------------
@@ -583,6 +586,10 @@ public class CuratorDb {
return applicationRoot.append(application.serializedForm());
}
+ private static Path instancePath(ApplicationId id) {
+ return instanceRoot.append(id.serializedForm());
+ }
+
private static Path runsPath(ApplicationId id, JobType type) {
return jobRoot.append(id.serializedForm()).append(type.jobName());
}
