scylladb / scylla-ansible-roles

Ansible roles for deploying and managing Scylla, Scylla-Manager and Scylla-Monitoring
44 stars 38 forks source link

scylla-node: improve idempotence of RAID setup #226

Closed vladzcloudius closed 1 year ago

vladzcloudius commented 1 year ago

Run scylla_raid_setup only if there isn't a scylla mount yet.

The previous logic tried to check the number of disk in md0 SW RAID. This was bogus for multiple reasons:

1) Scylla RAID can be not md0 but any mdX. By default scylla_raid_setup is going to try an unused mdX for X'es between 0 and 9. 2) This logic breaks even worse for a single NVMe card configurations - these won't even use SW RAID.

This patch changes the logic to explicitly check for mounts with 'scylla' in their mount point name. If exists - scylla_raid_setup won't be called.

This will avoid scylla_raid_setup from being called if that mount had been created using Scylla Role, because Role calls 'scylla_raid_setup' with a default mount point name, which will be '/var/lib/scylla'.

In any other case - scylla_raid_setup is going to be invoked and will try to create a RAID on top of requested devices. If it fails - the play will fail too.

Fixed #219