speedb-io / speedb

A RocksDB compliant high performance scalable embedded key-value store
https://www.speedb.io/
Apache License 2.0
856 stars 63 forks source link

WriteController: Remove redundant setting delay reports with single db #831

Closed Yuval-Ariel closed 5 months ago

Yuval-Ariel commented 5 months ago

The WC currently reports to the log whenever a new delay request is handled (even if its the same rate). These msgs are redundant in cases where the WC is only shared with 1 db and hence 1 logger since similar msgs are reported in ColumnFamilyData::RecalculateWriteStallConditions.

Currently it looks like :

2024/02/11-12:34:41.726676 7213 [WARN] [/write_controller.cc:153] WC setting delay of 178892456, client_id: 0x563f8a2e8f60, client rate: 178892456
2024/02/11-12:34:41.726684 7213 [WARN] [/column_family.cc:1235] [default] Stalling writes because we have 12 level-0 files rate 178892456

This PR removes the msg from the write_controller (the first) when there is only 1 logger to report to.

CLAassistant commented 5 months ago

CLA assistant check
All committers have signed the CLA.

udi-speedb commented 5 months ago

@Yuval-Ariel - Why not avoid logging in the WC to the reporter's logger? This would achieve what this PR is for as well as have a single log record (instead of 2) in the reporter's log.

Yuval-Ariel commented 5 months ago

@Yuval-Ariel - Why not avoid logging in the WC to the reporter's logger? This would achieve what this PR is for as well as have a single log record (instead of 2) in the reporter's log.

@udi-speedb , what you're suggesting wouldnt work when a logger is shared between two dbs. the db that initated the request will get a msg but the other one wouldnt.

udi-speedb commented 5 months ago

@Yuval-Ariel - Why not avoid logging in the WC to the reporter's logger? This would achieve what this PR is for as well as have a single log record (instead of 2) in the reporter's log.

@udi-speedb , what you're suggesting wouldnt work when a logger is shared between two dbs. the db that initated the request will get a msg but the other one wouldnt.

Wouldn't the reporter get a log message from its own column_family.cc code while the other(s) would log the WC's message?

Yuval-Ariel commented 5 months ago

@Yuval-Ariel - Why not avoid logging in the WC to the reporter's logger? This would achieve what this PR is for as well as have a single log record (instead of 2) in the reporter's log.

@udi-speedb , what you're suggesting wouldnt work when a logger is shared between two dbs. the db that initated the request will get a msg but the other one wouldnt.

Wouldn't the reporter get a log message from its own column_family.cc code while the other(s) would log the WC's message?

its the same logger. so both dbs will get any msg

udi-speedb commented 5 months ago

OK, but if there are multiple delay sources (cf-s, WBM) wouldn't you miss the min rate and only see the new rate?

Yuval-Ariel commented 5 months ago

OK, but if there are multiple delay sources (cf-s, WBM) wouldn't you miss the min rate and only see the new rate?

we would still get the msg from the cf that initiated the delay