-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[IMPROVED] MQTT stream per session replaced with single stream #2501
Conversation
With the availability of a "max message per subject" for a given stream, it is possible to replace individual streams that were created per session with a single stream that gets all sessions as a single message per subject, which subject is composed of the session client ID hash. The first time the new stream is created for a given account, all existing MQTT session streams will be transferred to the new mux'ed MQTT session stream. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
@@ -200,6 +201,7 @@ func (c *cluster) shutdown() { | |||
os.Remove(cf) | |||
} | |||
if sd != _EMPTY_ { | |||
sd = strings.TrimSuffix(sd, JetStreamStoreDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@derekcollison I noticed that the temporary directory nats-server
would still be filled with empty directory, such as jetstream12345678
. Since it seems that under this directory, the server would actually create jetstream
directory, this remove all would remove jetstream
but leave the empty parent directory.
This change helps cleaning up, and seems that JetStream pass, but keep that in mind if later when writing a test in case this change has an effect (for instance if you were expecting only jetstream
to be removed but not the parent dir, etc..).
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
With the availability of a "max message per subject" for a given
stream, it is possible to replace individual streams that were
created per session with a single stream that gets all sessions
as a single message per subject, which subject is composed of
the session client ID hash.
The first time the new stream is created for a given account,
all existing MQTT session streams will be transferred to the
new mux'ed MQTT session stream.
Signed-off-by: Ivan Kozlovic ivan@synadia.com