On Sun, May 29, 2016 at 12:01:39PM +0200, Iustin Pop wrote: > 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.
Ah blast. No, I'm not sure. When diagnosing DRBD issues on live clusters nodeA always seemed to be the primary, so I assumed that this invariant was enforced by the code. I'll submit a patch to fix this shortly. Thanks, Brian.