File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -446,11 +446,15 @@ func (js *js) CreateKeyValue(cfg *KeyValueConfig) (KeyValue, error) {
446
446
// and we are now moving to a v2.7.2+. If that is the case
447
447
// and the only difference is the discard policy, then update
448
448
// the stream.
449
+ // The same logic applies for KVs created pre 2.9.x and
450
+ // the AllowDirect setting.
449
451
if err == ErrStreamNameAlreadyInUse {
450
452
if si , _ = js .StreamInfo (scfg .Name ); si != nil {
451
453
// To compare, make the server's stream info discard
452
454
// policy same than ours.
453
455
si .Config .Discard = scfg .Discard
456
+ // Also need to set allow direct for v2.9.x+
457
+ si .Config .AllowDirect = scfg .AllowDirect
454
458
if reflect .DeepEqual (& si .Config , scfg ) {
455
459
si , err = js .UpdateStream (scfg )
456
460
}
You can’t perform that action at this time.
0 commit comments