Used only by PassiveStream::processMarker().
I've seen enough issues caused by the unnecessary complexity of merging multiple snapshots of different type (disk/memory) into the same checkpoint at replica. Eg,
MB-41283 and MB-42780.
It would be nice to remove the function. But the problem is that we may end up creating many (thousands) checkpoints when the system in under load and replica receives many Memory snapshots from the active.
At least we should avoid to use the function at snapshot transition (ie, disk->memory or memory->disk). Ie, at snapshot transition replica should always create a new checkpoint for storing the new incoming snapshot.
Note: In theory the active should always set the MARKER_FLAG_CHK when transitioning from a snapshot type to another. I believe that since 6.5.0 we get it right, but before 6.5.0 we had issues in that area (eg,
MB-32862). So, we should probably make replica resilient to any Active misbehaviour with regard to MARKER_FLAG_CHK. That would avoid further issues like MB-41283 and MB-42780.
- is triggered by
MB-42780 [Upgrade] Rebalance_in failed with reason "bulk_set_vbucket_state_failed :: sync_shutdown_many_i_am_trapping_exits"