[Gluster-devel] GD 2 xlator option changes
Kaushal Madappa
kaushal at redhat.com
Thu Jan 18 06:20:49 UTC 2018
On Mon, Jan 15, 2018 at 12:14 PM, Nithya Balachandran
<nbalacha at redhat.com> wrote:
> Hi,
>
> A few questions about this:
>
> 1. What (if anything) should be done for options like these which have "!" ?
>
> /* Switch xlator options (Distribute special case) */
> { .key = "cluster.switch",
> .voltype = "cluster/distribute",
> .option = "!switch",
> .type = NO_DOC,
> .op_version = 3,
> .flags = VOLOPT_FLAG_CLIENT_OPT
> },
>
Most of the options which had '!' prefixed are supposed to be skipped
by volume set for validation. These options mostly affected something
in volgen, mainly enabling/disabling certain translators. With the new
volgen that Aravinda has comeup with, these checks can should be added
to the respective graph building functions. But you still need to add
these into the options table of an xlator. You should add this to the
distribute options table as 'switch' and a BOOL option and the same
goes with 'cluster.nufa'.
Or alternatively, as these are options enabling and disabling xlators
that replace the standard distribute xlator, we could treat them as
completely new volume types and have seperate volgen functions for
these volumes.
>
> 2. How should the changed key names handled?
>
> In glusterd:
>
> { .key = "cluster.switch-pattern",
> .voltype = "cluster/switch",
> .option = "pattern.switch.case",
> .type = NO_DOC,
> .op_version = 3,
> .flags = VOLOPT_FLAG_CLIENT_OPT
> },
>
>
> In dht src code:
> /* switch option */
> { .key = {"pattern.switch.case"},
> .type = GF_OPTION_TYPE_ANY,
> .op_version = {3},
> .flags = OPT_FLAG_CLIENT_OPT,
> },
>
You should add this as an additional key in the xlator options table,
'switch-pattern'. In GD2 the users will then be able to set it as
'distribute.switch-pattern' or 'switch.switch-pattern' not
'cluster.switch-pattern'. This is something I'd like to do with GD2,
ie. have unique domains for each xlator in the <domain>.<key> option
naming format.
I have a question for you though. Can switch and nufa be normal
options to distribute that switch behaviour?
Right now, they're seperate xlators, meaning we need to either have
special case handling for these options in volgen, or treat them as
different volume types and have seperate volgen for them. Both of
require some coding to be done in GD2 by the respective maintainers.
But if they were options, there would be no nufa/switch specific code,
and instead GD2 would be able to handle them as standard options. The
distribute xlator could then use these options as switches to choose
specific behaviours.
If this doesn't seem like a good idea, let me know.
>
>
> Regards,
> Nithya
>
More information about the Gluster-devel
mailing list