We study analytically the superfluid flow of a Bose-Einstein condensate in a ring geometry in presence of a rotating barrier. We show that a phase transition breaking a parity symmetry among two topological phases occurs at a critical value of the height of the barrier. Furthermore, a discontinuous (accompanied by hysteresis) phase transition is observed in the ordered phase when changing the angular velocity of the barrier. At the critical point where the hysteresis area vanishes, chemical potential of the ground state develops a cusp (a discontinuity in the first derivative). Along this path, the jump between the two corresponding states having a different winding number shows strict analogies with a topological phase transition. We finally study the current-phase relation of the system and compare some of our calculations with published experimental results. In the limit of a vanishing barrier, the state with topological defects adiabatically connect two rotation-invariant states with different winding number . A second-order phase transition takes place two times as a function of Ω [19], first as the system enters the state with topological defects from the first rotational-invariant state 1 and then as it leaves the former by entering the second rotational-invariant state 2 . This scenario changes in presence of any finite-size obstacle that breaks the rotational symmetry of the ring, wherein the topological defects are always dynamically unstable [20], so that, in general, two topologically different states cannot be adiabatically connected. This has been recently confirmed experimentally with a barrier moving inside a toroidal BEC [21], where hysteresis appears in the transition between states with different topological winding number. The unstable branch of the hysteresis loop corresponds to the state with topological defects, and the angular velocity at which the metastable state decays (through phase slippage [7]) into the ground state generalizes the Landau critical velocity to the weak-link case [16,20].In this manuscript, we show that with a barrier rotating at the angular velocity Ω c = /2mR 2 , with R and m the radius of the ring and the atomic mass, respectively, the ground state of the system becomes degenerate when the height of the barrier is smaller than a critical value V < V c . The degeneration arises from a parity symmetry breaking that provides two