docs: @Patch("/status")
      @Consumes("application/json-patch+json")
      @RequiresAdministrator
      public CompletableFuture<ServerStatus> updateStatus(ServiceRequestContext ctx,
                                                          JsonNode patch) throws Exception {
          // TODO(trustin): Consider extracting this into common utility or Armeria.
          final ServerStatus oldStatus = status();
          final JsonNode oldValue = Jackson.valueToTree(oldStatus);
          final JsonNode newValue;
          try {
              newValue = JsonPatch.fromJson(patch).apply(oldValue);
          } catch (JsonPatchException e) {
              // Failed to apply the given JSON patch.
              return rejectStatusPatch(patch);
          }
  
          if (!newValue.isObject()) {
              return rejectStatusPatch(patch);
          }
  
          final JsonNode writableNode = newValue.get("writable");
          final JsonNode replicatingNode = newValue.get("replicating");
          if (!writableNode.isBoolean() || !replicatingNode.isBoolean()) {
              return rejectStatusPatch(patch);
          }
  
          final boolean writable = writableNode.asBoolean();
          final boolean replicating = replicatingNode.asBoolean();
          if (writable && !replicating) {
              return HttpApiUtil.throwResponse(ctx, HttpStatus.BAD_REQUEST,
                                               "'replicating' must be 'true' if 'writable' is 'true'.");
          }
  
          if (oldStatus.writable) {
              if (!writable) { // writable -> unwritable
                  executor().setWritable(false);
                  if (replicating) {
                      logger.warn("Entered read-only mode with replication enabled");
                      return CompletableFuture.completedFuture(status());
                  } else {
                      logger.warn("Entering read-only mode with replication disabled ..");
                      return executor().stop().handle((unused, cause) -> {
                          if (cause != null) {
                              logger.warn("Failed to stop the command executor:", cause);
                          } else {
                              logger.info("Entered read-only mode with replication disabled");
                          }
                          return status();
                      });
                  }
              }
          } else if (writable) { // unwritable -> writable
              logger.warn("Leaving read-only mode ..");
              executor().setWritable(true);
              return executor().start().handle((unused, cause) -> {
                  if (cause != null) {
                      logger.warn("Failed to leave read-only mode:", cause);
                  } else {
                      logger.info("Left read-only mode");
                  }
                  return status();
              });
          }
  
          throw HttpStatusException.of(HttpStatus.NOT_MODIFIED);
      }