[GODRIVER-2127] Go Driver should have a retry after invalid ClusterTime Created: 11/Aug/21 Updated: 27/Oct/23 Resolved: 27/Sep/21 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | 1.6.0 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Unknown |
| Reporter: | Vinicius Grippa | Assignee: | Matt Dale |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Similar to https://jira.mongodb.org/browse/PYTHON-1434 Go Driver should have a retry option when receiving a bad ClusterTime. Otherwise, similar issue is observed: 2021-08-11T01:27:14.161Z I COMMAND [conn27172109] command admin.$cmd appName: "<redacted>" command: isMaster { ismaster: 1, $clusterTime: { clusterTime: Timestamp(1628645233, 6), signature: { keyId: 0, hash: BinData(0, 0000000000000000000000000000000000000000) }}, $db: "admin", $readPreference: { mode: "primary" }} numYields:0 ok:0 errMsg:"Cache Reader No keys found for HMAC that is valid for time: { ts: Timestamp(1628645233, 6) }with id: 0" errName:KeyNotFound errCode:211 reslen:315 protocol:op_msg 2ms |
| Comments |
| Comment by PM Bot [ 27/Sep/21 ] | |||||||||||||||||||||||||||||||||||
|
There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information. | |||||||||||||||||||||||||||||||||||
| Comment by Matt Dale [ 11/Sep/21 ] | |||||||||||||||||||||||||||||||||||
|
vgrippa@gmail.com thanks for the info about your MongoDB deployment. I've started a discussion about updating the drivers specification to handle the KeyNotFound error in DRIVERS-1904. As far as the problems that are causing the driver to encounter KeyNotFound errors in the first place, I have two theories:
As far as reproducing the error manually, I modified Operation.updateClusterTimes() in the Go driver with something like the following code:
| |||||||||||||||||||||||||||||||||||
| Comment by Vinicius Grippa [ 29/Aug/21 ] | |||||||||||||||||||||||||||||||||||
|
Hi Matt, Thanks for checking. Let me answer your questions: What MongoDB server version are you using? Let me know if this helps. | |||||||||||||||||||||||||||||||||||
| Comment by Matt Dale [ 26/Aug/21 ] | |||||||||||||||||||||||||||||||||||
|
Hey vgrippa@gmail.com, thanks for the extra information, that's really helpful! I was able to reproduce the error you described by manually overwriting the $clusterTime doc returned from a server with one with an invalid keyId and an increased timestamp. I'm investigating possible ways for the driver to recover from getting an invalid $clusterTime doc from the server. I've got a few questions to help me understand your use case better:
| |||||||||||||||||||||||||||||||||||
| Comment by Vinicius Grippa [ 17/Aug/21 ] | |||||||||||||||||||||||||||||||||||
|
Hi Matt, Thanks for checking. Maybe you might find this useful: Downgrading to 1.3.0 solves the issue. I believe it is because Go Driver 1.3.0 does not check the cluster time: type HandshakeOptions struct { AppName string Authenticator Authenticator Compressors []string DBUser string PerformAuthentication func(description.Server) bool }... desc, err := operation.NewIsMaster(). While Go Driver 1.6.0 checks: op := operation.NewIsMaster(). Hope it helps. | |||||||||||||||||||||||||||||||||||
| Comment by Matt Dale [ 17/Aug/21 ] | |||||||||||||||||||||||||||||||||||
|
Hey vgrippa@gmail.com, thanks for reporting this issue! We will look into it soon. |