function isCluster(Connection $connection)
{
    static $isCluster = null;
    if ($isCluster === null) {
        $adminHandler = new AdminHandler($connection);
        try {
            $role = $adminHandler->getServerRole();
            $isCluster = $role === 'COORDINATOR' || $role === 'DBSERVER';
        } catch (\Exception $e) {
            // maybe server version is too "old"
            $isCluster = false;
        }
    }
    return $isCluster;
}