public Snapshot move(SnapshotId id, String hostname, Snapshot.State newState) {
        try (var lock = lock(hostname)) {
            Snapshot current = require(id, hostname);
            Instant now = nodeRepository.clock().instant();
            return write(id, hostname, node -> {
                if (!busyWith(id, node)) {
                    throw new IllegalArgumentException("Cannot move snapshot " + id + " to " + newState +
                                                       ": Node " + hostname + " is not working on this snapshot");
                }
                return current.with(newState, now);
            }, lock);
        }
    }
Change state of an active snapshot
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/backup/Snapshots.java