-
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-4134: link rev cache memory limit config option to rev cache #7084
Conversation
@@ -246,8 +246,9 @@ type DeprecatedCacheConfig struct { | |||
} | |||
|
|||
type RevCacheConfig struct { | |||
Size *uint32 `json:"size,omitempty"` // Maximum number of revisions to store in the revision cache |
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.
We can't remove config options like this, it would be a breaking change for customers with existing configuration.
If we want to keep the size
JSON field name, and rename the internal struct field to MaxItemCount
to better represent the behaviour in the codebase, we can do that. The alternatve would be adding a new property, deprecating Size
but still allowing it as a fallback.
Both of these options come with downsides.
rest/config.go
Outdated
MaxItemCount *uint32 `json:"max_item_count,omitempty"` // Maximum number of revisions to store in the revision cache | ||
MaxMemoryCountMB *uint32 `json:"max_memory_count_mb"` // Maximum amount of memory the rev cache should consume in MB |
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.
What's the behaviour when both of these are set? The lower of the two?
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.
Correct, both will work in tandem with one another when memory limit is set. I have added a comment to MaxMemoryCountMB
to reflect this info, let me know if it needs work.
Redocly previews |
Signed-off-by: Gregory Newman-Smith <[email protected]>
* CBG-4134: link rev cache memory limit config option to rev cache * failing tests * address commnets * fix yaml lint * fix failing test + mistake in docs Signed-off-by: Gregory Newman-Smith <[email protected]> --------- Signed-off-by: Gregory Newman-Smith <[email protected]>
* CBG-4023: Removal unmarshalled body on the rev cache (#7030) * CBG-4135: new stat for rev cache capacity (#7049) * CBG-4135: new stat for rev cache capacity * updated based on review * fix linter * lint again * CBG-4032: memory based rev cache implementation (#7040) * CBG-4032: memory based rev cache implementation * make test pass with default collection + missing return param * more issues with default collection test * touch ups on comment + remove unused function * updated for review * further tidy up * lint fix after refector test * fixes from rebase * updates based off review + some more refactoring * CBG-4134: link rev cache memory limit config option to rev cache (#7084) * CBG-4134: link rev cache memory limit config option to rev cache * failing tests * address commnets * fix yaml lint * fix failing test + mistake in docs Signed-off-by: Gregory Newman-Smith <[email protected]> --------- Signed-off-by: Gregory Newman-Smith <[email protected]> * CBG-4234: clean up rev cache work (#7113) * CBG-4234: clean up rev cache work * new test * CBG-4277: Remove unused totalBytesForHistory from getHistory (#7137) --------- Signed-off-by: Gregory Newman-Smith <[email protected]> Co-authored-by: Gregory Newman-Smith <[email protected]>
* CBG-4023: Removal unmarshalled body on the rev cache (#7030) * CBG-4135: new stat for rev cache capacity (#7049) * CBG-4135: new stat for rev cache capacity * updated based on review * fix linter * lint again * CBG-4032: memory based rev cache implementation (#7040) * CBG-4032: memory based rev cache implementation * make test pass with default collection + missing return param * more issues with default collection test * touch ups on comment + remove unused function * updated for review * further tidy up * lint fix after refector test * fixes from rebase * updates based off review + some more refactoring * CBG-4134: link rev cache memory limit config option to rev cache (#7084) * CBG-4134: link rev cache memory limit config option to rev cache * failing tests * address commnets * fix yaml lint * fix failing test + mistake in docs Signed-off-by: Gregory Newman-Smith <[email protected]> --------- Signed-off-by: Gregory Newman-Smith <[email protected]> * CBG-4234: clean up rev cache work (#7113) * CBG-4234: clean up rev cache work * new test * CBG-4277: Remove unused totalBytesForHistory from getHistory (#7137) --------- Signed-off-by: Gregory Newman-Smith <[email protected]> Co-authored-by: Gregory Newman-Smith <[email protected]>
CBG-4134
Pre-review checklist
fmt.Print
,log.Print
, ...)base.UD(docID)
,base.MD(dbName)
)docs/api
Dependencies (if applicable)
Integration Tests
GSI=true,xattrs=true
https://jenkins.sgwdev.com/job/SyncGateway-Integration/2673/