hi,
Afr needs context based defaults for quorum where by default quorum value is 'none' for 2-way replica and 'auto' for 3 way replica. Anuradha sent http://review.gluster.org/11872 to fix the same. May be we can come up with more generic solution. The present solution remembers the default in volinfo->options and also written to the store. So the default will be shown in "volume info" output and if we want to change the defaults in future we will need to carefully think of all the things that could go wrong especially peers getting rejected because of the md5sum mismatch. Another way to solve the same problem is to generate the default value of the vme-option based on the context of the volume when we have to write to the volfile. In this particular case, we need to generate default as 'none' for 2-way-replica-count volume. and 'auto' for 3-replica-count volume. For volume-get command handling also we need to consider this dynamic default value. For implementing this, we can add a new member 'context_based_default_value_get()'(please feel free to come up with better name for the function :-) ) to the vme-table which can be invoked to get the default option which takes the volinfo as parameter at least, and not set .value i.e implicitly .value will be NULL.

This is based on earlier design detail in the comment of vme-table:
* Fourth field is <value>. In this context they are used to specify
* a default. That is, even the volume dict doesn't have a value,
* we procced as if the default value were set for it.

We just want to enhance the existing behavior with this proposed change. It seems more generic than the present solution in the patch. In future people can write their own implementations of context based default value generation following same procedure. Let me know your comments.

Pranith
_______________________________________________
Gluster-devel mailing list
Gluster-devel@gluster.org
http://www.gluster.org/mailman/listinfo/gluster-devel

Reply via email to