Skip to content

Backport of [Feature] Invalidate session check if associated session is deleted into release/1.21.x#22233

Merged
srahul3 merged 3 commits into
release/1.21.xfrom
backport/srahul3/session-checks/smoothly-unified-jackal
Mar 20, 2025
Merged

Backport of [Feature] Invalidate session check if associated session is deleted into release/1.21.x#22233
srahul3 merged 3 commits into
release/1.21.xfrom
backport/srahul3/session-checks/smoothly-unified-jackal

Conversation

@hc-github-team-consul-core
Copy link
Copy Markdown
Collaborator

Backport

This PR is auto-generated from #22227 to be assessed for backporting due to the inclusion of the label backport/1.21.

The below text is copied from the body of the original PR.


Background

The ESM is also requested to go agentless, being agentless it becomes challenging to keep track of the health of the artificial node.

Proposal

This pull request introduces a new feature to support Consul Session to update the state of the health-checks. The constraint is, the health-check needs to be of type session and both session and the health-check shall belong to common parent node.

The idea is to use the sessions to keep track of health status. During partition of ESM crash, the session is deleted and hence, the changes in this PR enables to make the associated session checks to be critical. On thus event, the other ESM instance picks up the leadership and re-distribute the responsibility among remaining health ESM instances.

There is need for a regular session to be created with name <session-name>
There is new check which is proposed of type Type="session" and Definition.SessionName=<session-name>.

** Code sequence **

  1. Session invalidates / ttl timer to no reset
  2. Session is destroyed
  3. The destruction process also checks if the session node has as special check of type session. This session health-check also has a field which suggest the session name. If this check's session name matches with this session name, the check's name is marked critical.

Testing

Unit test added

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core requested a review from a team as a code owner March 20, 2025 04:30
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/srahul3/session-checks/smoothly-unified-jackal branch from bf30f34 to 044d9b8 Compare March 20, 2025 04:30
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved Consul Bot automated PR

@github-actions github-actions Bot added theme/api Relating to the HTTP API interface theme/health-checks Health Check functionality labels Mar 20, 2025
Copy link
Copy Markdown
Collaborator

@srahul3 srahul3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM

@srahul3 srahul3 merged commit 1f486aa into release/1.21.x Mar 20, 2025
@srahul3 srahul3 deleted the backport/srahul3/session-checks/smoothly-unified-jackal branch March 20, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme/api Relating to the HTTP API interface theme/health-checks Health Check functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants