Skip to content

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

Closed
hc-github-team-consul-core wants to merge 5 commits into
release/1.20.xfrom
backport/srahul3/session-checks/awfully-valued-glider
Closed

Backport of [Feature] Invalidate session check if associated session is deleted into release/1.20.x#22232
hc-github-team-consul-core wants to merge 5 commits into
release/1.20.xfrom
backport/srahul3/session-checks/awfully-valued-glider

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.20.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

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

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

@hashicorp-cla-app
Copy link
Copy Markdown

hashicorp-cla-app Bot commented Mar 20, 2025

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


1 out of 2 committers have signed the CLA.

  • srahul3
  • temp

temp seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

@hashicorp-cla-app
Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


temp seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

@srahul3 srahul3 marked this pull request as ready for review March 20, 2025 10:50
@srahul3 srahul3 marked this pull request as draft March 20, 2025 10:50
@srahul3 srahul3 marked this pull request as ready for review March 20, 2025 11:33
@srahul3 srahul3 requested a review from a team as a code owner March 20, 2025 11:33
srahul3
srahul3 previously approved these changes 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 added 2 commits March 20, 2025 21:25
@srahul3
Copy link
Copy Markdown
Collaborator

srahul3 commented Mar 21, 2025

Substituted by #22236, hence closing this PR.

@srahul3 srahul3 closed this Mar 21, 2025
@github-actions github-actions Bot deleted the backport/srahul3/session-checks/awfully-valued-glider branch September 17, 2025 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants