Steady state replication throttling POC - #3
harrylin98 wants to merge 35 commits into
Conversation
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
…ths (valkey-io#3600) The `pending_command` flag indicates that a client has a fully parsed command ready for execution. This update ensures that the flag is set/cleared consistently across different execution paths. --------- Signed-off-by: harrylin98 <harrylin980107@gmail.com>
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
430a560 to
72ebc75
Compare
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
72ebc75 to
5904359
Compare
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
JimB123
left a comment
There was a problem hiding this comment.
I focused on the APIs. Big comments:
- APIs (.h files) need solid documentation
- Avoid pulling in Amazon overdesign
- Consider each thing in the .h file. Ask does this need to be part of the API? Why?
| long oldest_client_delay_us; | ||
| } throttleMetrics; | ||
|
|
||
| /* Public API */ |
There was a problem hiding this comment.
The public API should be fully documented.
There was a problem hiding this comment.
+1, This is applicable to all the .h files we have included here.
|
|
||
| void tokenBucket_capDebt(tokenBucket *bucket, double max_debt); | ||
| double tokenBucket_add(tokenBucket *bucket, double tokens); | ||
| double tokenBucket_replenish(tokenBucket *bucket); |
There was a problem hiding this comment.
No need for this to be an API. This can happen intrinsically.
| long oldest_client_delay_us; | ||
| } throttleMetrics; | ||
|
|
||
| /* Public API */ |
There was a problem hiding this comment.
+1, This is applicable to all the .h files we have included here.
| tokenBucket *bucket; | ||
| list *client_queue; | ||
| listNode *ln; /* my node in throttlerList */ | ||
| monotime rate_below_guardrail_since; |
There was a problem hiding this comment.
Isn't this field more related to repl-throttle specifically? I think a generic throttle framework shouldn't care about guardrails. Can we please track it in throttle-repl.c somewhere ?
| static list *throttlerList = NULL; | ||
| static hashtable *metricsTable = NULL; | ||
|
|
||
| typedef struct throttler { |
There was a problem hiding this comment.
One liner Documentation on structures and its members would help the readability.
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
041c81d to
ec331ac
Compare
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
802f610 to
9a1ca67
Compare
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
e99ce3d to
53b098f
Compare
81ade19 to
c2a2485
Compare
35244c2 to
8f30657
Compare
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
7aaa28a to
2d69b73
Compare
84d90a9 to
b819547
Compare
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
b819547 to
31e9714
Compare
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
7253432 to
b050201
Compare
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
fe4577b to
9749a33
Compare
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
aa49e5d to
c0d21c6
Compare
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
4851661 to
6cd9f79
Compare
Signed-off-by: harrylin98 <harrylin980107@gmail.com>
No description provided.