Jetstream issue with fileStore disabled.
samstride opened this issue · 4 comments
Hi,
Thanks for maintaining the helm chart.
Running into the following issue on chart nats-1.0.2
and app 2.9.21
A config with fileStore
disabled:
config:
cluster:
enabled: true
replicas: 3
jetstream:
enabled: true
memoryStore:
enabled: true
maxSize: 128Mi
fileStore:
enabled: false
podTemplate:
topologySpreadConstraints:
kubernetes.io/hostname:
maxSkew: 1
whenUnsatisfiable: ScheduleAnyway
Is causing the clients to throw this error:
nats: insufficient storage resources available
Things are back to normal once filestore
is enabled.
Is this expected behaviour?
What command are the clients executing?
If they are trying to make a file-backed stream then it's expected.
@caleblloyd , I am using the official go client.
connectionOptions := []nats.Option{
// Activate retry logic if a connection cannot be established at the start.
nats.RetryOnFailedConnect(true),
nats.ReconnectHandler(func(_ *nats.Conn) {
// Note that this will be invoked for the first asynchronous connect.
logger.Info("Connection to NATS restored ...")
}),
natsConnection, natsJetStream, err := NewJetStreamConnection(
natsURL,
connectionOptions,
nil, // nil jetstream options
)
if err != nil {
return nil, nil, err
}
Hmmm, something must have changed.
I don't now if that may be related with your problem, but the default storage type is, according to the documentation, the file one.
btw, the go client follow that :
const (
// FileStorage specifies on disk storage. It's the default.
FileStorage StorageType = iota
// MemoryStorage specifies in memory only.
MemoryStorage
)
I don't know how you manage your streams, but I guess you should explicitly set the memory storage type for them 🤷 .
@jeromedoucet . Thanks. Yes, looks like client now defaults to Filestorage.
It's interesting because previously clients did not need to specify it and nats would automatically handle things. So previously we had:
- Nats with jetstream memory enabled and filestore disabled
- clients did not have to specify any jetstream options.
After client update, jetstream is defaulting to filestore. This means that we either:
- enable filestore on jetstream and not update client code
- OR keep jetstream filestore disabled and update client code to specify the necessary option
I kinda prefer the old behaviour but I am sure there were reasons to move away from that.
Thanks.