replica: advance gc state only when xlog is closed
Advancing replica->gc on every status update is inefficient as gc can only be invoked when we move to the next xlog file. Currently, it's acceptable, because status is only updated once per second, but there's no guarantee that it won't be updated say every millisecond in future, in which case advancing replica->gc on every status update may become too costly. So introduce a trigger invoked every time an xlog is closed by recover_remaining_wals() and use it in relay to send a special gc message.
Loading
Please register or sign in to comment