ydb-platform / nbs

Network Block Store
Apache License 2.0
50 stars 16 forks source link

[NBS] Optimize TxCleanupDevices in DiskRegistry #1394

Open qkrorlqr opened 1 month ago

qkrorlqr commented 1 month ago

DiskRegistry updates the states of multiple devices from each agent upon this tx. However DiskRegistry rewrites the config of each agent once for each devices - i.e. if it wants to update the states of 100 devices from one agent it will rewrite the same agent config 100 times. Sometimes we run into the 256MiB tx size limit because of this problem and it brings the whole dirty device cleanup process to a halt.

The problem lies here: https://github.com/ydb-platform/nbs/blob/75787dba846c876a34a98fa7c5540babca2a2af7/cloud/blockstore/libs/storage/disk_registry/disk_registry_state.cpp#L3588 We need to optimize TxCleanupDevices to update the config of each agent only once per agent.