Add context to operations

Add pre and post local replica merge operations