I guess we should drop a new config file at install time into `etc/couchbase/kv/opcode-attributes.json` with the something like the following syntax:
{
|
"version": 1,
|
"default": {
|
"slow": 500
|
},
|
"get": {
|
"slow": 100
|
},
|
"compact_db": {
|
"slow": "30 min"
|
}
|
}
|
Where `version` indicates the format of the file, `default` is the entry we use unless there is an explicit entry for the the opcode and the rest is expected to be the opcode to modify. For now just we'll just add the attribute `slow` which indicates the threshold limit for assuming a value being slow. If the value is specified as a number it is the number of milliseconds. If specified as a string it may include a specifier such as us, ms, sec, min (, h, d, y
).
memcached reads the default from this file (no hardcoded defaults anymore). After parsing that file it'll scan `etc/couchbase/kv/opcode-attributes.d` and apply each entry found there in alphabetical order. These files would normally contain a single entry. (this allows for ns_server to drop in one entry per command, and the user could even override that by creating `Z-final.json`
A new config key (`opcode-attribute-file`) in `memcached.json` is needed in order to allow for easy unit testing.
To allow for easy checks we should create a new command to mcctl: `opcode-attributes`
Ex:
$ mcctl set opcode-attributes `{
|
"version": 1,
|
"default": {
|
"slow": 500
|
},
|
"get": {
|
"slow": 100
|
},
|
"compact_db": {
|
"slow": "30 min"
|
}
|
}'
|
One question is: Do we want to be able to be able to specify these on a per bucket level...
Build couchbase-server-7.2.0-1029 contains kv_engine commit c86ff24 with commit message:
MB-25632: Opcode attributes: document dynamic changing via mcctl