feat: add num_retries metric to write operation metrics #3848
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Track the number of commit retry attempts in operationMetrics for write operations.
Changes
I have added num_retries to WriteMetrics struct which will be available inside operationMetrics inside delta log. I have used #[serde(default)] for backward compatibility with old delta logs.
The reason for the current approach was because operationMetrics is written to the delta log before we know how many retries were needed, making it difficult to include in the persisted log. Hence I do reserialise the commit log again.
Result
Delta log now includes num_retries in operationMetrics: {
"operationMetrics": {
"num_added_files": 5,
"num_retries": 2,
...
}
}
Related Issue(s)
Documentation