Delete cluster node endpoint does not remove clusternodeheartbeat record

XMLWordPrintable

    • 11.03
    • 1
    • Severity 3 - Minor

      Issue Summary

      Deleting a node using the DELETE /api/2/cluster/node/{nodeId} REST API does not fully purge all metadata. While the node record is removed from the clusternode table, stale records remain in the clusternodeheartbeat table.

      Steps to Reproduce

      1. Setup a 2-node Jira Data Center clustered environment.
      2. Shut down one of the nodes.
      3. Once the node is reported as "Offline", delete it using the REST API:
        curl -X DELETE -u $ADMIN_USER "$BASE_URL/rest/api/2/cluster/node/$NODE_ID"
        
      4. Check the database tables clusternode and clusternodeheartbeat.

      Expected Results

      The records for $NODE_ID should be purged from both the clusternode and clusternodeheartbeat tables to ensure no stale metadata remains.

      Actual Results

      The record is removed from clusternode, but a stale entry persists in clusternodeheartbeat.

      Workaround

      Stop the entire cluster and manually delete the stale heartbeat record from the database:

      DELETE FROM clusternodeheartbeat WHERE NODE_ID = '$NODE_ID';
      

      Note: Always perform a database backup and test in a lower environment before executing direct SQL manipulations.

              Assignee:
              Unassigned
              Reporter:
              Moga
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: