Manually forcing a merge is considered a one-time option, because
after the merge operation is performed (via a temporary
aggressive change to the merge policy), the merge policy
reverts to its previous setting.
Forcing an
index merge is used to perform a complete merge of all generations without
making a change to the default merge policy. When you issue this command, it is
routed to the leader Dgraph node and the Dgraph starts a manual merge of its
index files. After the merging is performed, the merge policy reverts to its
previous setting.
Forcing a merge implies starting a full merge of all generations of
index files. When running this command, be aware of the following
considerations:
- Memory requirements. Forcing
a complete merge utilizes the server's memory. If the amount of memory reaches
the amount of RAM that is available, the merge operation will continue to work,
but could run substantially slower and have a higher impact on query
performance.
- Disk space requirements.
Forcing a merge requires provisioning two times the amount of disk space as the
current size of the index files. However, if the Dgraph is performing other
tasks (such as updates), the merge may require disk space that is three times
the size of the index files. If not enough disk space is provisioned, it could
be disruptive to force a complete merge. This consideration is especially
important for running this command on the Dgraph in a production environment.