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

Shutdown process triggered twice during if the node is drained

    XMLWordPrintableJSON

Details

    • 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

              ifesdjeen Alex Petrov
              ifesdjeen Alex Petrov
              Alex Petrov
              Stefania Alborghetti
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: