Resonant magnetic perturbations and edge ergodization on the COMPASS tokamak