On Thu, May 26, 2016 at 03:56:10PM +0100, Ganeti Development List wrote:
> This is exercised by the luxi QueryInstances call when the sinst_cnt and
> sint_list fields are used. This uses a lot of CPU and does a lot of
> short-lived heap allocation on clusters with many instances.
> 
> The reimplementation allocates fewer temporary values, and does fewer
> object lookups by UUID. The net effect is to reduce heap use from ~3.2GB
> to ~1.5GB, and CPU use from ~1200ms to ~770ms in a test harness using
> a config with 1000 DRBD instances on 80 nodes.
> 
> Signed-off-by: Brian Foley <bpfo...@google.com>

Hi Brian,

> +-- | Computes the secondary node UUID for a DRBD disk
> +computeDiskSecondaryNode :: Disk -> Maybe String
> +computeDiskSecondaryNode dsk =
> +  case diskLogicalId dsk of
> +    Just (LIDDrbd8 _nodeA nodeB _ _ _ _) -> Just nodeB

Are you sure this snippet is correct? If I remember correctly and things
haven't changed, disks do not record primary/secondary roles, they only
hold the nodes. I.e. nodeA ≠ primary, it's simple one of the nodes of
the disk, similary with nodeB. Hence the naming A/B, instead of Pri/Sec.

Only the instance knows its current primary node, and thus you need that
to be able to determine which is the disk's secondary node.

regards,
iustin

Reply via email to