diff options
author | HÃ¥kon Hallingstad <hakon.hallingstad@gmail.com> | 2023-01-04 22:55:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-04 22:55:46 +0100 |
commit | 270066ea9f652a3f60765e6afaee1f126f711ff2 (patch) | |
tree | ce589cf23381d85ccda13bbc2d35cfa6b753cff6 | |
parent | 0d15a90264be2ffdf955e2ce8099dc7d43944f55 (diff) |
Revert "Add missing writes to unified node path"
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Nodes.java | 2 | ||||
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/CuratorDb.java | 9 |
2 files changed, 2 insertions, 9 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Nodes.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Nodes.java index 2590db9434b..807710eac72 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Nodes.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Nodes.java @@ -182,8 +182,8 @@ public class Nodes { nodesToAdd.add(node); } NestedTransaction transaction = new NestedTransaction(); - db.removeNodes(nodesToRemove, transaction); List<Node> resultingNodes = db.addNodesInState(IP.Config.verify(nodesToAdd, list(lock)), Node.State.provisioned, agent, transaction); + db.removeNodes(nodesToRemove, transaction); transaction.commit(); return resultingNodes; } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/CuratorDb.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/CuratorDb.java index 4da788da7a3..c52d98fadc9 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/CuratorDb.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/CuratorDb.java @@ -115,10 +115,7 @@ public class CuratorDb { throw new IllegalArgumentException(node + " is not in the " + expectedState + " state"); node = node.with(node.history().recordStateTransition(null, expectedState, agent, clock.instant())); - // TODO(mpolden): Remove after migration to nodesPath - byte[] serialized = nodeSerializer.toJson(node); - curatorTransaction.add(CuratorOperations.create(toPath(node).getAbsolute(), serialized)); - curatorTransaction.add(CuratorOperations.create(nodePath(node).getAbsolute(), serialized)); + curatorTransaction.add(CuratorOperations.create(toPath(node).getAbsolute(), nodeSerializer.toJson(node))); } for (Node node : nodes) @@ -139,11 +136,7 @@ public class CuratorDb { for (Node node : nodes) { Path path = toPath(node.state(), node.hostname()); CuratorTransaction curatorTransaction = db.newCuratorTransactionIn(transaction); - // TODO(mpolden): Remove after migration to nodesPath curatorTransaction.add(CuratorOperations.delete(path.getAbsolute())); - if (db.exists(nodePath(node))) { - curatorTransaction.add(CuratorOperations.delete(nodePath(node).getAbsolute())); - } } nodes.forEach(node -> log.log(Level.INFO, "Removed node " + node.hostname() + " in state " + node.state())); } |