Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

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 <[email protected]>
Signed-off-by: Camille Dela Rosa <[email protected]>
Signed-off-by: Camille Dela Rosa <[email protected]>
Signed-off-by: Camille Dela Rosa <[email protected]>
Signed-off-by: Camille Dela Rosa <[email protected]>
@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

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.

2 participants