Using locks with eventual consistency