unsplit icon indicating copy to clipboard operation
unsplit copied to clipboard

write documentation

Open uwiger opened this issue 15 years ago • 5 comments

uwiger avatar Feb 05 '10 14:02 uwiger

I'd be delighted to see some notes or even documentation on how to use unsplit with ejabberd to automatically resolv network splits.

With ejabberd I normally dont mind losing a little info if it means I can maintain a coherent cluster - and users on all nodes can continue to communicate with each other.

phedders avatar Feb 12 '13 15:02 phedders

Hi, I'm new to Erlang and Mnesia but I have set up a cluster of 3 ejabberd XMPP servers. In my context, these 3 servers are suppose to encounter netsplits quite often. That's why I'm very interested in your framework. I'd like to give it a try but I have no idea how to install it. Could you provide me a simple step-by-step instructions? Thanks.

joudinet avatar Feb 10 '14 17:02 joudinet

Can't say that the documentation is stellar, but:

  • https://github.com/uwiger/unsplit/blob/master/commands.txt
  • https://github.com/uwiger/unsplit/wiki

... and the README.md

There is also some detail in http://www.erlang-factory.com/upload/presentations/286/MnesiaEFLondon2010.pdf

That is, in order to use unsplit, just make sure it's started. Then, add an 'unsplit_method' user property for tables that you want to be able to merge.

For example:

mnesia:create_table(
        test,[{ram_copies,[n1@debian,n2@debian]},
              {attributes,record_info(fields, test)},
              {user_properties,
               [{unsplit_method {unsplit_lib,vclock, [#test.vclock]}}]
             ]).

uwiger avatar Feb 10 '14 17:02 uwiger

Thanks for the links. It does help me but how can I add an 'unsplit_method' to an existing table? The tables are created by ejabberd and I would like to add the user_properties field to these tables, without having to modify ejabberd source code so it does it when creating the tables.

Alternative question: Since I plan to use the same method for every table, how can I set the default method as mention in the README.md: {default_method, {Module, Function, ExtraArgs}}

joudinet avatar Feb 13 '14 16:02 joudinet

I discovered that the functions mnesia:add_table_property/2, mnesia:read_table_property/1 and mnesia:delete_table_property/1 aren't documented. Too bad. They are the ones you should use.

E.g. mnesia:add_table_property(test, {unsplit_method, {unsplit_lib,vclock,[#test.vclock]}})

The default method can be set via an unsplit application environment variable, default_method, e.g.:

  {default_method, {unsplit_lib, vclock, [vclock]}}

uwiger avatar Feb 17 '14 23:02 uwiger