Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-12509

Shutdown process triggered twice during if the node is drained

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Severity:
      Normal

      Description

      If the node is drained, the StorageService#drain method is called, which triggers shutdown of mutation stage, messaging service, compaction, batchlog etc. In the end of this process, the node is moved to DRAINED status with the process still running.

      When JVM is shutdown, the JVM shutdown hooks are ran, which are subscribed during the server initialisation: Runtime.getRuntime().addShutdownHook(drainOnShutdown); here.

      I noticed this behaviour while reviewing CASSANDRA-12461, as if we'd like add custom pre and post-shutdown hooks, most likely it makes sense to run them once (or user might expect such behaviour).

      Is this behaviour correct? Should we run whole shutdown process twice or just once in "drain" and no-op during JVM shutdown?

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              ifesdjeen Alex Petrov Assign to me
              Reporter:
              ifesdjeen Alex Petrov
              Authors:
              Alex Petrov
              Reviewers:
              Stefania Alborghetti

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment