-
Notifications
You must be signed in to change notification settings - Fork 138
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
CBG-3686 add idle kv ops stat #6642
Conversation
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.
Question about the cbgt ops, and suggestion to move the stat incr to after the op completes.
base/heartbeat.go
Outdated
@@ -280,6 +280,7 @@ func (h *couchbaseHeartBeater) checkStaleHeartbeats(ctx context.Context) error { | |||
continue | |||
} | |||
|
|||
SyncGatewayStats.GlobalStats.ResourceUtilizationStats().NumIdleKvOps.Add(1) |
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.
I think we generally want to increment the stat after the operation is performed, not before. Doing it before the error check is fine if that's what you were trying to avoid.
base/sg_cluster_cfg.go
Outdated
@@ -95,8 +95,8 @@ func (c *CfgSG) Set(cfgKey string, val []byte, cas uint64) (uint64, error) { | |||
return 0, fmt.Errorf("cfg_sg: key cannot start with a colon") | |||
} | |||
|
|||
SyncGatewayStats.GlobalStats.ResourceUtilizationStats().NumIdleKvOps.Add(1) |
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.
The PR description said you added this stat for CfgSG.Get, but you've got it on Set here.
Having said that - what Cfg operations are actually being performed by cbgt when the DCP feed is idle? I had thought it was notified about cfg changes via Subscribe(), and didn't do polling.
Remove unused stat for CfgSG. Add docs
Setup up two SG nodes in two modes and compared stat on server for idle ops:
CfgSg
operations will only show up if there's multiple SGs.I had uncertainty about what level to put the calls, especially
GetMetadataDocument
. In this case, some idle operations are going to get called. I could move this to the bootstrap polling when we callGetDatabaseConfigs
. On the other hand, I could move this intoconfig_persistentence.go
and cover xattr and non xattr case.For heartbeater, I put the Get cases, but not the updating the node lists, which presumably happens on a rebalance. I think this is most correct.
For
CfgSg
, I added for Get operations, since againSet
will happen for ISGR or cbgt DCP rebalance.The concerns I have are as follows:
Pre-review checklist
fmt.Print
,log.Print
, ...)base.UD(docID)
,base.MD(dbName)
)docs/api
Integration Tests
GSI=true,xattrs=true
https://jenkins.sgwdev.com/job/SyncGateway-Integration/000/