<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
Manual resolution of split-brains [1] has been a tedious task
involving understanding and modifying AFR's changelog extended
attributes. To simplify and to an extent automate this task, we are
proposing a new CLI command with which the user can specify what
the source brick/file is, and automatically heal the files in the
appropriate direction.
<br>
<br>
Command: gluster volume resolve-split-brain <VOLNAME>
{<bigger_file> | source-brick <brick_name>
[<file>] }
<br>
<br>
Breaking up the command into its possible options, we have:
<br>
<br>
a) gluster volume resolve-split-brain <VOLNAME>
<bigger_file>
<br>
When this command is executed, AFR will consider the brick having
the highest file size as the source and heal it to all other bricks
(including all other sources and sinks) in that replica subvolume.
If the file size is same in all the bricks, it does <b
class="moz-txt-star"><span class="moz-txt-tag">*</span>not<span
class="moz-txt-tag">*</span></b> heal the file.
<br>
<br>
b) gluster volume resolve-split-brain <VOLNAME > source-brick
<brick_name > [<file>]
<br>
<br>
When this command is executed, if <file> is specified, AFR
heals the file from the source-brick <brick_name> to all other
bricks of that replica subvolume. For resolving multiple files, the
command must be run iteratively, once per file.
<br>
If <file> is not specified, AFR heals all the files that have
an entry in .glusterfs/indices/xattrop <b class="moz-txt-star"><span
class="moz-txt-tag">*</span>and<span class="moz-txt-tag">*</span></b>
are in split-brain. As before, heals happen from source-brick
<brick_name> to all other bricks.
<br>
<br>
Future work could also include extending the command to add other
policies like choosing the file having the latest mtime as the
source, integration with trash xlator wherein the files deleted from
the sink are moved to the trash dir etc.<br>
<br>
Please give feedback on the above. <br>
<br>
Regards,<br>
Ravi<br>
<br>
[1] <a class="moz-txt-link-freetext"
href="https://github.com/gluster/glusterfs/blob/master/doc/split-brain.mdVOLNAME">https://github.com/gluster/glusterfs/blob/master/doc/split-brain.md</a>
</body>
</html>