grab key locks for key wide read operations
added most of the logic for atomicoperation