hscan: fix long-standing bug with node memory data
authorIustin Pop <iustin@google.com>
Tue, 4 Jan 2011 15:02:07 +0000 (16:02 +0100)
committerIustin Pop <iustin@google.com>
Fri, 7 Jan 2011 15:39:32 +0000 (16:39 +0100)
commit693342ad3b37d546bbe5123128790c8f7877ec9f
tree5d529446ec9cb0d8c99b03dcf5f7a198cc96fee0
parent55da339e9a14c5a7e26fc14477595b5d40c4beac
hscan: fix long-standing bug with node memory data

There is a long-standing bug in hscan, due to the serialization
workflow. Basically, hscan loads data from the remote cluster(s),
processes it via Loader.mergeData and Loader.checkData, then
serializes it. The Loader function will update the node memory values
as if the down instances were running, and then hscan saves the
_modified_ values.

When another program (e.g. hbal) loads the text files, it will
re-apply the Loader functions, in effect subtracting the instance
memory twice, which is course offers a wrong cluster view.

To fix this bug, we change a bit the internal workflow in hscan, so
that we serialize the unmodified cluster data, and only use the
modified one for the display of cluster state (and verification that
yes, we can load the data).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Balazs Lecz <leczb@google.com>
hscan.hs