Skip to content

jetstream - setting allow_msg_ttl on a stream that had it on doesn't return an error #6872

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

Open
aricart opened this issue May 6, 2025 · 4 comments
Assignees
Labels
defect Suspected defect such as a bug or regression

Comments

@aricart
Copy link
Member

aricart commented May 6, 2025

Observed behavior

Previously the server rejected requests to change allow_msg_ttl when it was true to false with the message subject marker delete cannot be set if message TTLs are disabled now it simply doesn't do the update, but doesn't return an error

Expected behavior

Return an error

Server and client version

2.11.2

Host environment

any

Steps to reproduce

const jsm = await jetstreamManager(nc);
  const si = await jsm.streams.add({
    name: "A",
    subjects: ["a"],
    allow_msg_ttl: true,
    subject_delete_marker_ttl: nanos(60_000),
  });
  assertEquals(si.config.allow_msg_ttl, true);
  assertEquals(si.config.subject_delete_marker_ttl, nanos(60_000));

  await assertRejects(
    () => {
      //@ts-expect-error: this is a test
      return jsm.streams.update("A", { allow_msg_ttl: false });
    },
    Error,
    "subject marker delete cannot be set if message TTLs are disabled",
  );
@aricart aricart added the defect Suspected defect such as a bug or regression label May 6, 2025
@MauriceVanVeen MauriceVanVeen self-assigned this May 6, 2025
@MauriceVanVeen
Copy link
Member

Since 4ca4b98 we now default AllowMsgTTL if SubjectDeleteMarkerTTL is set.

If pedantic is set on the update request then this error will be returned.

@ripienaar
Copy link
Contributor

Of the 2 I think the Boolean should be authoritative - go Boolean handling isn’t helping sigh.

@aricart
Copy link
Member Author

aricart commented May 6, 2025

The pedantic option for JetStream - I implemented it for the javascript clients (it is opt-in), but current guidance is that clients won't implement it...

@MauriceVanVeen
Copy link
Member

Then it's probably best to either remove that assertion, or adapt it to check AllowMsgTTL remains true because it's defaulted by SubjectDeleteMarkerTTL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

3 participants