Backport Make kmip forwarded requests obey the best-effort-wal-wait-duration config into ce/main (#12321)

This commit is contained in:
Vault Automation 2026-02-13 09:04:07 -05:00 committed by GitHub
parent 9839d40b10
commit 22e5336265
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

3
changelog/_12313.txt Normal file
View file

@ -0,0 +1,3 @@
```release-note:improvement
secrets/kmip (Enterprise): Obey configured best_effort_wal_wait_duration when forwarding kmip requests.
```

View file

@ -33,7 +33,17 @@ func (e extendedSystemViewImpl) ForwardGenericRequest(ctx context.Context, req *
ctx = namespace.ContextWithNamespace(ctx, e.mountEntry.Namespace())
ctx = logical.IndexStateContext(ctx, &logical.WALState{})
ctx = context.WithValue(ctx, ctxKeyForwardedRequestMountAccessor{}, e.mountEntry.Accessor)
return forward(ctx, e.core, req)
resp, err := forward(ctx, e.core, req)
if err != nil {
return nil, err
}
if req.LastRemoteWAL() > 0 && !e.core.EntWaitUntilWALShipped(ctx, req.LastRemoteWAL()) {
if resp == nil {
resp = &logical.Response{}
}
resp.AddWarning("Timeout hit while waiting for local replicated cluster to apply primary's write; this client may encounter stale reads of values written during this operation.")
}
return resp, nil
}
return nil, logical.ErrReadOnly