Diagnostics Improvements for quorumAckedLSN, CurrentReplicaSetSize, and replicaStatusList
Description
Diagnostics now has two new fields inside of the storeResult which is quorumAckedLSN and currrentReplicaSetSize. The replicaStatusList field was changed to use the following format, and it should display all the replicas. The attempting means it could have been looked at in the operation that happened. It also includes whether the replica is a primary or secondary now.
"replicaStatusList": {
"Attempting": ["25475:Primary:Connected"],
"NotAttempting": ["nnnnn:Secondary:UnhealthyPending"]
},
The following is an example of a diagnostic now
{"userAgent":"azsdk-java-cosmos/4.59.0-beta.1 Windows11/10.0 JRE/11.0.22","activityId":"e6888d4d-7955-4370-b97e-26b9957d16a4","requestLatencyInMs":148,"requestStartTimeUTC":"2024-04-29T16:42:11.922469800Z","requestEndTimeUTC":"2024-04-29T16:42:12.071245300Z","responseStatisticsList":[{"storeResult":{"storePhysicalAddress":"rntbd://cdb-ms-prod-westus3-be11.documents.azure.com:14412/apps/3bb2924a-2c0f-4ef7-b543-05db443c4511/services/09f6953f-c129-45e5-9bce-96a81219fd90/partitions/b6087803-45b9-410b-83e8-aa2a8ad45d8a/replicas/133588707014983174p/","lsn":4,"quorumAckedLSN":3,"currentReplicaSetSize":4,"globalCommittedLsn":3,"partitionKeyRangeId":"1","isValid":true,"statusCode":200,"subStatusCode":0,"isGone":false,"isNotFound":false,"isInvalidPartition":false,"isThroughputControlRequestRateTooLarge":false,"requestCharge":10.29,"itemLSN":-1,"sessionToken":"1:-1#4","backendLatencyInMs":3.397,"retryAfterInMs":null,"replicaStatusList":{"NotAttempting":["14375:Secondary:Unknown","14145:Secondary:Unknown","14362:Secondary:Unknown"],"Attempting":["14412:Primary:Connected"]},"transportRequestTimeline":[{"eventName":"created","startTimeUTC":"2024-04-29T16:42:11.938173800Z","durationInMilliSecs":0.0},{"eventName":"queued","startTimeUTC":"2024-04-29T16:42:11.938173800Z","durationInMilliSecs":0.0},{"eventName":"channelAcquisitionStarted","startTimeUTC":"2024-04-29T16:42:11.938173800Z","durationInMilliSecs":68.1448},{"eventName":"pipelined","startTimeUTC":"2024-04-29T16:42:12.006318600Z","durationInMilliSecs":19.1533},{"eventName":"transitTime","startTimeUTC":"2024-04-29T16:42:12.025471900Z","durationInMilliSecs":40.3486},{"eventName":"decodeTime","startTimeUTC":"2024-04-29T16:42:12.065820500Z","durationInMilliSecs":2.9058},{"eventName":"received","startTimeUTC":"2024-04-29T16:42:12.068726300Z","durationInMilliSecs":1.5079},{"eventName":"completed","startTimeUTC":"2024-04-29T16:42:12.070234200Z","durationInMilliSecs":0.0}],"rntbdRequestLengthInBytes":615,"rntbdResponseLengthInBytes":526,"requestPayloadLengthInBytes":91,"responsePayloadLengthInBytes":0,"channelStatistics":{"channelId":"857d980a","channelTaskQueueSize":0,"pendingRequestsCount":0,"lastReadTime":"2024-04-29T16:42:10.820852800Z","waitForConnectionInit":false},"serviceEndpointStatistics":{"availableChannels":1,"acquiredChannels":0,"executorTaskQueueSize":0,"inflightRequests":1,"lastSuccessfulRequestTime":"2024-04-29T16:42:10.822Z","lastRequestTime":"2024-04-29T16:42:10.755Z","createdTime":"2024-04-29T16:42:08.516971300Z","isClosed":false,"cerMetrics":{}}},"requestResponseTimeUTC":"2024-04-29T16:42:12.071245300Z","requestStartTimeUTC":"2024-04-29T16:42:11.938173800Z","requestResourceType":"Document","requestOperationType":"Upsert","requestSessionToken":null,"e2ePolicyCfg":null,"excludedRegions":null}],"supplementalResponseStatisticsList":[],"addressResolutionStatistics":{},"regionsContacted":["west us 3"],"retryContext":{"statusAndSubStatusCodes":null,"retryLatency":0,"retryCount":0},"metadataDiagnosticsContext":{"metadataDiagnosticList":null},"serializationDiagnosticsContext":{"serializationDiagnosticsList":[{"serializationType":"ITEM_SERIALIZATION","startTimeUTC":"2024-04-29T16:42:11.923466700Z","endTimeUTC":"2024-04-29T16:42:11.924464500Z","durationInMilliSecs":0.9978},{"serializationType":"PARTITION_KEY_FETCH_SERIALIZATION","startTimeUTC":"2024-04-29T16:42:11.931164700Z","endTimeUTC":"2024-04-29T16:42:11.931164700Z","durationInMilliSecs":0.0}]},"gatewayStatisticsList":[],"samplingRateSnapshot":1.0,"systemInformation":{"usedMemory":"35094 KB","availableMemory":"4159210 KB","systemCpuLoad":"(2024-04-29T16:41:52.844865500Z 100.0%), (2024-04-29T16:41:57.859051100Z 13.6%), (2024-04-29T16:42:02.850706200Z 6.6%), (2024-04-29T16:42:04.585728700Z 12.0%), (2024-04-29T16:42:09.600528100Z 12.4%)","availableProcessors":12},"clientCfgs":{"id":4,"machineId":"uuid:7b6c22d3-dc35-460e-a4eb-cebb8ab2b842","connectionMode":"DIRECT","numberOfClients":3,"excrgns":"[]","clientEndpoints":{"https://tomasvaron-cdb.documents.azure.com:443/":4},"connCfg":{"rntbd":"(cto:PT5S, nrto:PT5S, icto:PT0S, ieto:PT1H, mcpe:130, mrpc:30, cer:true)","gw":"(cps:1000, nrto:PT1M, icto:PT1M, p:false)","other":"(ed: true, cs: false, rv: true)"},"consistencyCfg":"(consistency: null, mm: true, prgns: [])","proactiveInitCfg":"","e2ePolicyCfg":"","sessionRetryCfg":""}}
Fixes https://github.com/Azure/azure-sdk-for-java/issues/39775 https://github.com/Azure/azure-sdk-for-java/issues/39762
All SDK Contribution checklist:
- [x] The pull request does not introduce [breaking changes]
- [x] CHANGELOG is updated for new features, bug fixes or other significant changes.
- [x] I have read the contribution guidelines.
General Guidelines and Best Practices
- [x] Title of the pull request is clear and informative.
- [x] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.
Testing Guidelines
- [x] Pull request includes test coverage for the included changes.
API change check
APIView has identified API level changes in this PR and created following API reviews.
/azp run java - cosmos - tests
Azure Pipelines successfully started running 1 pipeline(s).