-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Follower stats #126
Follower stats #126
Conversation
cda7fed
to
92024b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a few comments.
Can you also share sample response type?
var shardStats :MutableMap<ShardId, FollowerShardStats> = mutableMapOf() | ||
var indexStats :MutableMap<String, FollowerIndexStats> = mutableMapOf() | ||
|
||
var pausedIndices :Int = 0 | ||
var failedIndices :Int = 0 | ||
var bootstrappingIndices :Int = 0 | ||
var syncingIndices :Int = 0 | ||
var shardTaskCount :Int = 0 | ||
var indexTaskCount :Int = 0 | ||
|
||
var opsWritten: Long = 0 | ||
var opsWriteFailures: Long = 0 | ||
var opsWriteThrottles: Long = 0 | ||
var opsRead: Long = 0 | ||
var opsReadFailures: Long = 0 | ||
var opsReadThrottles: Long = 0 | ||
var localCheckpoint: Long = 0 | ||
var remoteCheckpoint: Long = 0 | ||
var totalWriteTime: Long = 0 | ||
|
||
companion object { | ||
private val log = LogManager.getLogger(FollowerStatsResponse::class.java) | ||
} | ||
|
||
constructor(inp: StreamInput) : super(inp) { | ||
shardStats = inp.readMap(::ShardId, ::FollowerShardStats) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to always derive from shardStats and only store that?
Main concerns on storing the same data twice is potential paths to introduce bugs where the paths are inconsistently handled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the same in latest revision.
src/main/kotlin/org/opensearch/replication/task/shard/FollowerClusterStats.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/replication/task/shard/FollowerClusterStats.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/replication/task/shard/ShardReplicationTask.kt
Outdated
Show resolved
Hide resolved
retentionLeaseHelper.renewRetentionLease(leaderShardId, indexShard.lastSyncedGlobalCheckpoint, followerShardId) | ||
followerClusterStats.stats[followerShardId]!!.localCheckpoint = indexShard.lastSyncedGlobalCheckpoint | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we extract renew + stats update into a member method? This is so we don't miss if we introduce newer paths to renew.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is difficult to do that as we are updating stats at 4 different places in 3 different scenarios :
- GetChanges success
- GetChanges failure and want to know the reason as well.
- Retention lease success
src/main/kotlin/org/opensearch/replication/task/shard/TranslogSequencer.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/replication/task/shard/ShardReplicationTask.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/replication/task/shard/ShardReplicationTask.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/replication/task/shard/ShardReplicationTask.kt
Show resolved
Hide resolved
92024b8
to
9a72686
Compare
Signed-off-by: Gaurav Bafna <[email protected]>
9a72686
to
83ff763
Compare
Signed-off-by: Gaurav Bafna <[email protected]>
Signed-off-by: Gaurav Bafna <[email protected]>
Description
API to aggregate follower cluster's metrics at cluster and index level
Issues Resolved
#125
Sample Response
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.