Skip to content

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

Merged
srahul3 merged 1 commit into
release/1.20.xfrom
backport/srahul3/session-checks/one_dot_twenty_dot_x
Mar 20, 2025
Merged

Backport of [Feature] Invalidate session check if associated session is deleted into release/1.20.x#22236
srahul3 merged 1 commit into
release/1.20.xfrom
backport/srahul3/session-checks/one_dot_twenty_dot_x

Conversation

@srahul3
Copy link
Copy Markdown
Collaborator

@srahul3 srahul3 commented Mar 20, 2025

Backport

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

The person who merged in the original PR is:
@srahul3
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: POST https://api.github.com/repos/hashicorp/consul/merges: 409 Merge conflict []

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

@srahul3 srahul3 requested review from a team as code owners March 20, 2025 14:59
@github-actions github-actions Bot added type/docs Documentation needs to be created/updated/clarified theme/api Relating to the HTTP API interface theme/health-checks Health Check functionality theme/acls ACL and token generation theme/cli Flags and documentation for the CLI interface theme/config Relating to Consul Agent configuration, including reloading theme/ui Anything related to the UI theme/telemetry Anything related to telemetry or observability type/ci Relating to continuous integration (CI) tooling for testing or releases pr/dependencies PR specifically updates dependencies of project theme/envoy/xds Related to Envoy support theme/contributing Additions and enhancements to community contributing materials theme/internals Serf, Raft, SWIM, Lifeguard, Anti-Entropy, locking topics labels Mar 20, 2025
@srahul3 srahul3 changed the base branch from main to release/1.20.x March 20, 2025 14:59
@srahul3 srahul3 added pr/no-changelog PR does not need a corresponding .changelog entry pr/no-backport labels Mar 20, 2025
@srahul3 srahul3 enabled auto-merge (squash) March 20, 2025 16:40
Copy link
Copy Markdown
Contributor

@nitin-sachdev-29 nitin-sachdev-29 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 776a326 into release/1.20.x Mar 20, 2025
@srahul3 srahul3 deleted the backport/srahul3/session-checks/one_dot_twenty_dot_x branch March 20, 2025 16:47
@srahul3
Copy link
Copy Markdown
Collaborator Author

srahul3 commented Mar 21, 2025

Backport of the original PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr/dependencies PR specifically updates dependencies of project pr/no-backport pr/no-changelog PR does not need a corresponding .changelog entry theme/acls ACL and token generation theme/api Relating to the HTTP API interface theme/cli Flags and documentation for the CLI interface theme/config Relating to Consul Agent configuration, including reloading theme/contributing Additions and enhancements to community contributing materials theme/envoy/xds Related to Envoy support theme/health-checks Health Check functionality theme/internals Serf, Raft, SWIM, Lifeguard, Anti-Entropy, locking topics theme/telemetry Anything related to telemetry or observability theme/ui Anything related to the UI type/ci Relating to continuous integration (CI) tooling for testing or releases type/docs Documentation needs to be created/updated/clarified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants