LINBIT / drbdtop

CLI management tool for DRBD. Like top, but for DRBD resources.
GNU General Public License v2.0
48 stars 14 forks source link

Experimental: Bundled updates #1

Closed raltnoeder closed 7 years ago

raltnoeder commented 7 years ago

Perform all the updates that were received in one drbdsetup call, then rebuild and order the list used for displaying and update the display.

I am not sure about the guarantees regarding the consistency of the resource collection map and the associated list, and about locking, so please check carefully, because while it worked in my tests now, it might unintentionally break future functionality.

The change works by introducing a new event type that is used as a signal for display updates in combination with a new ResourceCollection method UpdateList() that contains list rebuilding and ordering logic removed from Update(). The ResourceCollection lock is held while working on the list.

The lock is no longer held between updates of the map and the list, so the main question to think about would be whether or not map changes are allowed to be visible before the list is changed accordingly as well.