A cement slurry comprising a base for reducing the impact of an alkaline
solution may be displaced into a wellbore and allowed to set. The base
may comprise a metal carbonate that is soluble in water such as potassium
carbonate. The cement slurry may further include cement, water, and a
salt that is soluble in the water such as potassium chloride. The
alkaline solution may be present in a formate-based drilling fluid
displaced into the wellbore ahead of the cement slurry. Despite being
contacted by such an alkaline solution, the thickening time of the cement
slurry is long enough and the set time is short enough to provide for the
formation of an impermeable mass in the annulus of the wellbore. The
thickening times may range from about 4 hours to about 16 hours, and the
set times may be less than about 24 hours.