Describe the bug
Setup/Deployment : multi DC vault setup with consul as the storage backend and the consul data is being replicated using consul-replicate.
Bug : when data in the vault is updated in the primary datacenter, updated value is not reflected in the response from the secondary datacenter. This is because the data cached in the vault is almost permanent.
To Reproduce
Steps to reproduce the behavior:
Create a key (transit engine) in the primary datacenter
Run vault write -f transit/keys/alekh-test-13
Read the key in the secondary datacenter (after successful replication)
Expected behavior
In step-4, we get property value deletion_allowed=false, instead of true
New value is updated only after the leader election when cache is rebuilt.
Similar behavior is observed for other backends as well.
Environment:
Vault Server Version (retrieve with vault status):
# ./vault status
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed false
Total Shares 1
Threshold 1
Version 1.13.0-dev1
Build Date n/a
Storage Type consul
Cluster Name vault-cluster-67dc2e08
Cluster ID 7c42e0a1-8be9-59d5-2ec5-2032a2b9be6a
HA Enabled true
HA Cluster https://10.51.114.216:8201
HA Mode active
Active Since 2022-12-06T10:01:12.402497608Z
* Vault CLI Version (retrieve with `vault version`):
Vault v1.13.0-dev1
* Server Operating System/Architecture:
Describe the bug Setup/Deployment : multi DC vault setup with consul as the storage backend and the consul data is being replicated using consul-replicate.
Bug : when data in the vault is updated in the primary datacenter, updated value is not reflected in the response from the secondary datacenter. This is because the data cached in the vault is almost permanent.
To Reproduce Steps to reproduce the behavior: Create a key (transit engine) in the primary datacenter
vault write -f transit/keys/alekh-test-13
Read the key in the secondary datacenter (after successful replication)
./vault read transit/keys/alekh-test-13
Update any property (deletion_allowed here) of the key in the primary datacenter
curl --header "X-Vault-Token: <valid token>" --request POST --data @payload.json http://127.0.0.1:8200/v1/transit/keys/alekh-test-13/config
payload.json : https://developer.hashicorp.com/vault/api-docs/secret/transit#sample-payload-3
Read the key in the secondary datacenter (after successful replication)
./vault read transit/keys/alekh-test-13
Expected behavior In step-4, we get property value deletion_allowed=false, instead of true
New value is updated only after the leader election when cache is rebuilt.
Similar behavior is observed for other backends as well.
Environment:
vault status
):cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)" NAME="Debian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" VERSION_CODENAME=stretch ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"