[PATCH] ctdb-readonly: Do not abort if revoke of readonly record fails on a node

Amitay Isaacs amitay at gmail.com
Tue Aug 12 08:26:22 MDT 2014

On Tue, Aug 12, 2014 at 3:04 PM, Martin Schwenke <martin at meltin.net> wrote:

> On Tue, 12 Aug 2014 13:37:03 +1000, Amitay Isaacs <amitay at gmail.com>
> wrote:
> > Revoking readonly record involves first marking the record on dmaster
> > as RO_REVOKING_READONLY.  Then all the other nodes are sent updaterecord
> > control to get rid of RO_DELEGATIONS.  Once that succeeds, the record
> >
> > Currently, revoking of readonly delegations on the nodes is tried only
> > once.  If a node goes in recovery, it can fail updaterecord control and
> > revoke code will abort ctdb.  Since database recovery would revoke all
> > readonly delegations anyway, there is no reason to abort.  Simply undo
> > the start of revoke process by resetting RO_REVOKIGN_READONLY flag.
> As discussed:
> 1. Put the 2 if statements that have been switched back the way they
>    were. There's no value in the switch and it makes the patch less
>    clear.
> 2. RO_REVOKIGN_READONLY -> RO_REVOKING_READONLY   in the commit message.
> 3. Add a patch to take out header->rsn++, since header isn't used
>    afterwards by the calling code, and just put header->rsn + 1 in the
>    if condition.
I have split the patch into two.  The first one simply adds an early return
which makes the second patch smaller and easier to understand.F

Fixed the typo. I still prefer to keep header->rsn++ as is for now, so that
it stands out when reading the code.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: readonly.patches
Type: application/octet-stream
Size: 6641 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140813/ad624ea6/attachment.obj>

More information about the samba-technical mailing list