Skip to content

Fix nats-jetstream scaler to use account ID instead of name#6415

Closed
cmay-zh wants to merge 6 commits intokedacore:mainfrom
cmay-zh:main
Closed

Fix nats-jetstream scaler to use account ID instead of name#6415
cmay-zh wants to merge 6 commits intokedacore:mainfrom
cmay-zh:main

Conversation

@cmay-zh
Copy link

@cmay-zh cmay-zh commented Dec 11, 2024

NATS API uses account ID to filter by account (as confirmed by NATS team).
image

Current checks causes an issue when account ID and name are different. Updating the checks to use account ID instead.

To replicate issue, create a NATS account with name different from ID like below

  "account_details": [
    {
      "name": "platform",
      "id": "AABMFGXW62SSPMCCGFFOP7HFDFFBJWFAM3MC66OM2EHJDZS5CWTSHCWA",
      "memory": 0,
      "storage": 285,
      "reserved_memory": 0,
      "reserved_storage": 18446744073709551615,
      "accounts": 0,
      "ha_assets": 0,
      "api": {
        "total": 7088,
        "errors": 0
      },

Create nats-jetstream ScaledObject, check logs and find error “scaler”: “natsJetStreamScaler”, “error”: “leader node not found for consumer”

Checklist

Fixes #

Relates to #

@cmay-zh cmay-zh requested a review from a team as a code owner December 11, 2024 04:04
Signed-off-by: Camille Dela Rosa <camille.delarosa@zerohash.com>
Signed-off-by: Camille Dela Rosa <camille.delarosa@zerohash.com>
Signed-off-by: Camille Dela Rosa <camille.delarosa@zerohash.com>
Signed-off-by: Camille Dela Rosa <camille.delarosa@zerohash.com>
Signed-off-by: Camille Dela Rosa <camille.delarosa@zerohash.com>
Signed-off-by: Camille Dela Rosa <camille.delarosa@zerohash.com>
@JorTurFer
Copy link
Member

Hello
I get your requirement, but this is a potential breaking change that we must avoid. Mi proposal is to add an extra parameter like 'accountID' to provide the value, and then use it to match account ID instead of account name. WDYT?
If this new parameter is mutually exclusive with the current account, it should work without any incident

@zroubalik
Copy link
Member

Hello I get your requirement, but this is a potential breaking change that we must avoid. Mi proposal is to add an extra parameter like 'accountID' to provide the value, and then use it to match account ID instead of account name. WDYT? If this new parameter is mutually exclusive with the current account, it should work without any incident

💯

@stale
Copy link

stale bot commented Mar 4, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Mar 4, 2025
@stale
Copy link

stale bot commented Mar 13, 2025

This issue has been automatically closed due to inactivity.

@stale stale bot closed this Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale All issues that are marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants