fdb-kubernetes-operator: three_data_hall inconsistent connection string problem
What happened?
I have found a quirky issue happening when using three_data_hall; the issue consists in the k8s FoundationDB cluster status containing an outdated connection string which does not correspond to what the cluster is currently using:
A: connectionString: mydb:dZiqyRWzkuM8tZ6hHx4Z3xWsFdu4BV0F@10.10.2.18:4501,10.20.22.84:4501,10.20.60.215:4501,10.20.67.98:4501,10.20.81.100:4501,10.10.265.72:4501,10.20.217.63:4501,10.20.240.122:4501,10.20.243.153:4501
A: seedConnectionString: <none>
B: seedConnectionString: mydb:mCYmFHPkEfyKO5gl8ae5ocZPq2a0IJW4@10.10.20.248:4501,10.20.22.192:4501,10.20.67.101:4501,10.10.210.33:4501,10.10.241.115:4501,10.10.268.53:4501,10.10.277.35:4501,10.10.285.107:4501,10.20.220.3:4501
B: connectionString: mydb:9pION4FdMvW53gB4ikdjo61cs7HQKtK3@10.20.22.84:4501,10.20.60.215:4501,10.20.67.98:4501,10.20.81.100:4501,10.10.220.14:4501,10.10.265.72:4501,10.20.200.1:4501,10.20.217.63:4501,10.20.243.153:4501
C: seedConnectionString: mydb:mCYmFHPkEfyKO5gl8ae5ocZPq2a0IJW4@10.10.20.248:4501,10.20.22.192:4501,10.20.67.101:4501,10.10.210.33:4501,10.10.241.115:4501,10.10.268.53:4501,10.10.277.35:4501,10.10.285.107:4501,10.20.220.3:4501
C: connectionString: mydb:dZiqyRWzkuM8tZ6hHx4Z3xWsFdu4BV0F@10.10.2.18:4501,10.20.22.84:4501,10.20.60.215:4501,10.20.67.98:4501,10.20.81.100:4501,10.10.265.72:4501,10.20.217.63:4501,10.20.240.122:4501,10.20.243.153:4501
When checking directly via get \xff\xff/connection_string, the correct connection string for the cluster appears to be the one with generation ID 9pION4FdMvW53gB4ikdjo61cs7HQKtK3.
What did you expect to happen?
The operator-maintained connection string field should always match get \xff\xff/connection_string.
How can we reproduce it (as minimally and precisely as possible)?
- trigger pod rotation of some pods in data hall A; for example coordinators, by changing something in the podTemplate for coordinators
- repeat for for halls B and C until issue is manifest
Anything else we need to know?
Related: #1958
By my analysis the client issues are symptoms and not the cause: there is always going to be a client with an incorrect connection string if the operator-provided configmap does not contain the same connection string for all halls.
FDB Kubernetes operator
v1.47.0
Kubernetes version
$ kubectl version
Client Version: v1.29.3
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.30.4-eks-a737599
Cloud provider
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 20 (20 by maintainers)
In the next reconciliation run the operator should update the
ConfigMap.From the FDB bindings:
https://github.com/apple/foundationdb/blob/main/bindings/go/src/fdb/fdb.go#L408-L413 and based on your description it rather seems like you are having long running clients. But I would need to look inside the code to answer your question properly (I’ll try to find some time for this). The current recommendation would be to copy the cluster file with an init container to a place that is writable, e.g.: https://github.com/FoundationDB/fdb-kubernetes-operator/blob/main/config/samples/client.yaml#L42-L59.
Yesterday I found another instance of this problem, but it was slightly different:
FoundationDBClusterstatuswere the sameget \xff\xff/connection_string)@johscheuer let me know if I should do some other test or provide more information
The operator should notice that the connection strings are not matching: https://github.com/FoundationDB/fdb-kubernetes-operator/blob/v1.47.0/controllers/cluster_controller.go#L580-L586 and updates the connection string in the
FoundationDBClusterresource and then theupdateStatusreconciler will update theFoundationDBClusterresource status: https://github.com/FoundationDB/fdb-kubernetes-operator/blob/v1.47.0/controllers/update_status.go#L254-L263.It’s considered stable and can be used in production, but please test it first in your dev/test environment. If anything doesn’t work as expected please create a GitHub issue for it.
Interesting, I would have thought that after some time (I think the default reconciliation period is 10h) the connection string will be updated by the operator. Has the operator reconciled in that time? I would expect it didn’t execute another reconciliation loop in this case.
This is a known issue when multiple operator instances are used (like in the multi-region setup or in three-data-hall). I assume you used the split image as this is the default. In the newer unified image we added a propagation mechanism to reduce the time between an out-dated connection string. The TLDR here is that the fdb-kubernetes-monitor updates an annotation when the local cluster file changes (which is the case when the connection string is updated). The annotation change will then trigger a new reconciliation loop and the operator will update the
FoundationDBClusterresource and theConfigMap.I change the label to
questionas we fixed it in theunifiedimage and we have no plans to fix it for thesplitimage.