Introduce a new stat which indicates a bleve index's convergence#2152
Introduce a new stat which indicates a bleve index's convergence#2152Thejas-bhat merged 3 commits intomasterfrom
Conversation
index_converging
index/scorch/scorch.go
Outdated
| if rootEpoch, ok := m["CurRootEpoch"].(uint64); ok { | ||
| if lastMergedEpoch, ok := m["LastMergedEpoch"].(uint64); ok { | ||
| if lastPersistedEpoch, ok := m["LastPersistedEpoch"].(uint64); ok { | ||
| m["index_converging"] = !(lastMergedEpoch == rootEpoch && lastPersistedEpoch == rootEpoch) |
There was a problem hiding this comment.
maybe call index_idle which will be true if index is idle (when lastMergedEpoch == rootEpoch && lastPersistedEpoch == rootEpoch)
There was a problem hiding this comment.
i see. is there any specific reason why you'd want it that way? from what i gather based on the suggestion, it is just speaking the stat in a different way without adding any extra information to the stat relative what's defined right now (which can be renamed as index_active i guess?)
There was a problem hiding this comment.
ya either index_active or index_idle ... index_converging doesnt make sense
There was a problem hiding this comment.
Agree with Rahul here @Thejas-bhat - index_idle makes the most sense to me.
There was a problem hiding this comment.
sure but i will have to keep the stat as "index_active" at the cbft level because of how the stats have been initialised with a default value 0. so in a multi partition setup, index_idle means that all partitions MUST be idle so its an AND logic with the default value being 0. however, if we talk in terms of an index being active, atleast one partition being active serves the logic and the changes aren't that messy.
this is mainly why i chose index_active instead of index_idle, to keep the stats consistent between both bleve and cbft.
please let me know your thoughts on it.
There was a problem hiding this comment.
Fair enough, let's keep the naming consistent between the two though - so if you choose index_active let's go with it.
|
@Thejas-bhat I suppose we're getting another patch here with the |
|
Also, I saw your bool to uint conversion downstream - let's just make it an int here itself. |
so the main reason why I kept it as bool here and didn't bother to change it is because its semantically more correct to keep the stat as a bool at the bleve level. |
- introduce a new stat `index_bgthreads_active` which indicates whether all the partitions belong to an index on a specific node are in the process of reaching a steady state (due to background routines' activity). - if the value is false, its safe to assume that every partition of that index has reached a steady state (no merger/persister activity) - blevesearch/bleve#2152 Change-Id: I9603164a7cac6737de2daf5004589d00f2ad8833 Reviewed-on: https://review.couchbase.org/c/cbft/+/223958 Well-Formed: Build Bot <build@couchbase.com> Tested-by: <thejas.orkombu@couchbase.com> Reviewed-by: Abhi Dangeti <abhinav@couchbase.com>
index_bgthreads_activeindicates whether the background routines that maintain the index are busy doing some work. This means that the index hasn't converged to a steady state and there could be potential file segment merges or in-memory segment flushes still remaining.This stat is beneficial for the application layer to get better insight as to whether the index is doing some background work (which can have implications on the system's resource utilisation) or not.