A golang-driven exception error

We maintain a replica set in PSA mode in k8s. For some reasons, we redeployed the cluster, and then our application (using golang driver) could not write to the database, reporting an error:

topology.ServerSelectionError=server selection error: server selection timeout, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: xxxxxxl:27017, Type: Unknown, Last error: was a primary, but its set version or election id is stale }, { Addr: xxxxxxl:27017, Type: RSSecondary, Average RTT: 1091734 }, { Addr: xxxxxxl:27017, Type: RSArbiter, Average RTT: 1005485 }, ] }

but directly connected to the cluster through the mongo shell The write operation can be performed at that time, and the status of the cluster is also displayed as normal. After we restart the application, the fault is restored. But we don’t know the cause of the failure, why the application doesn’t continue to work after the DB cluster is restarted

mongod version: 4.4.10
golang-driver: 1.8.4