-->

How does Multiple shards per module support works

2019-08-21 10:34发布

问题:

The module-shards.conf file mentions the following :

For Helium we support only one shard per module. Beyond Helium we will support more than 1

Have ODL Nitrogen and trying to use "module-shards.conf" like the following :

module-shards = [
    {
        name = "default"
        shards = [
            {
                name="default1"
                replicas = [
                    "member-1"
                ]
            },
            {
                name="default2"
                replicas = [
                    "member-1"
                ]
            }
        ]
    }
]

That seems to be working as karaf shows the 2 shards successfully created for the same module "default". But how the data is distributed among the 2 shards is not clear, can application control/decide which data goes in which of the module shards.

I am not clear how the application config tree data and the operational tree data for a given module be stored under different shards for the same module. If there are multiple shards for the same module, can application decide/control which shard to use for storing a particular type of data. For example, can application decide to store the config tree in "default1" shard and operational tree in "default2" shard for the same module "default" ?

Is it possible to disable operational tree component for one of the shards of a given module, say disable operational tree component for shard "default2" of module "default" with 2 shards namely "default1" and "default2" ?

回答1:

While it says for Helium only one shard per module is supported, that is still the case - support for more than 1 was never implemented. There hasn't been a use case for that. The shards are created but transactions are only routed to one of them (ie picks the first one that is found).