Issue 5798 - MMR/mirror mode circumvents schema check
Summary: MMR/mirror mode circumvents schema check
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-08 14:22 UTC by ando@openldap.org
Modified: 2014-08-01 21:04 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ando@openldap.org 2008-11-08 14:22:41 UTC
Full_Name: Pierangelo Masarati
Version: HEAD/re24
OS: irrelevant
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (82.63.140.131)
Submitted by: ando


When syncrepl is configured, schema checking is switched off.  As a consequence,
schema checking does not occur for all writes, including direct writes from
clients when MMR/MM is in use.

Internal writes performed by syncrepl should be marked as such, in order to
disable schema checking only when appropriate.

p.

Comment 1 ando@openldap.org 2008-11-08 15:32:34 UTC
ando@sys-net.it wrote:
> Full_Name: Pierangelo Masarati
> Version: HEAD/re24
> OS: irrelevant
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (82.63.140.131)
> Submitted by: ando
> 
> 
> When syncrepl is configured, schema checking is switched off.  As a consequence,
> schema checking does not occur for all writes, including direct writes from
> clients when MMR/MM is in use.
> 
> Internal writes performed by syncrepl should be marked as such, in order to
> disable schema checking only when appropriate.

It all seems to boil down to the fact that syncrepl schemachecking is 
off by default.  So, not specifying any results in having multimasters 
with schemachecking disabled, which is not desirable.  I recommend 
schema checking be on by default.

p.


Ing. Pierangelo Masarati
OpenLDAP Core Team

SysNet s.r.l.
via Dossi, 8 - 27100 Pavia - ITALIA
http://www.sys-net.it
-----------------------------------
Office:  +39 02 23998309
Mobile:  +39 333 4963172
Fax:     +39 0382 476497
Email:   ando@sys-net.it
-----------------------------------

Comment 2 ando@openldap.org 2008-11-08 15:34:17 UTC
changed notes
Comment 3 Howard Chu 2008-11-08 15:45:55 UTC
ando@sys-net.it wrote:
> ando@sys-net.it wrote:
>> Full_Name: Pierangelo Masarati
>> Version: HEAD/re24
>> OS: irrelevant
>> URL: ftp://ftp.openldap.org/incoming/
>> Submission from: (NULL) (82.63.140.131)
>> Submitted by: ando
>>
>>
>> When syncrepl is configured, schema checking is switched off.  As a consequence,
>> schema checking does not occur for all writes, including direct writes from
>> clients when MMR/MM is in use.
>>
>> Internal writes performed by syncrepl should be marked as such, in order to
>> disable schema checking only when appropriate.
>
> It all seems to boil down to the fact that syncrepl schemachecking is
> off by default.  So, not specifying any results in having multimasters
> with schemachecking disabled, which is not desirable.  I recommend
> schema checking be on by default.

All we have to do is change the code from setting the DB flag to using the 
per-op o_no_schema_check flag. IMO defaulting schemacheck off for replication 
is fine because replicated entries will have been checked on the master.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 4 ando@openldap.org 2008-11-08 15:47:27 UTC
Howard Chu wrote:
> ando@sys-net.it wrote:
>> ando@sys-net.it wrote:
>>> Full_Name: Pierangelo Masarati
>>> Version: HEAD/re24
>>> OS: irrelevant
>>> URL: ftp://ftp.openldap.org/incoming/
>>> Submission from: (NULL) (82.63.140.131)
>>> Submitted by: ando
>>>
>>>
>>> When syncrepl is configured, schema checking is switched off.  As a 
>>> consequence,
>>> schema checking does not occur for all writes, including direct 
>>> writes from
>>> clients when MMR/MM is in use.
>>>
>>> Internal writes performed by syncrepl should be marked as such, in 
>>> order to
>>> disable schema checking only when appropriate.
>>
>> It all seems to boil down to the fact that syncrepl schemachecking is
>> off by default.  So, not specifying any results in having multimasters
>> with schemachecking disabled, which is not desirable.  I recommend
>> schema checking be on by default.
> 
> All we have to do is change the code from setting the DB flag to using 
> the per-op o_no_schema_check flag. IMO defaulting schemacheck off for 
> replication is fine because replicated entries will have been checked on 
> the master.

Well, it used to be so, but now with MMR (and mirror mode) it's no 
longer so.  Using the per-op is fine, as long as the caller consistently 
sets it.

p.


Ing. Pierangelo Masarati
OpenLDAP Core Team

SysNet s.r.l.
via Dossi, 8 - 27100 Pavia - ITALIA
http://www.sys-net.it
-----------------------------------
Office:  +39 02 23998309
Mobile:  +39 333 4963172
Fax:     +39 0382 476497
Email:   ando@sys-net.it
-----------------------------------

Comment 5 Howard Chu 2008-11-08 15:49:52 UTC
Howard Chu wrote:
> All we have to do is change the code from setting the DB flag to using the
> per-op o_no_schema_check flag. IMO defaulting schemacheck off for replication
> is fine because replicated entries will have been checked on the master.

Of course, it was already using the per-op flag too. Probably meant to remove 
the per-DB flag and forgot to some time ago. Fixed now in HEAD.
-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 6 Howard Chu 2008-11-08 15:54:42 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 7 ando@openldap.org 2008-11-08 16:02:05 UTC
changed notes
Comment 8 Hallvard Furuseth 2008-11-08 18:49:17 UTC
hyc@symas.com writes:
> IMO defaulting schemacheck off for replication is fine because
> replicated entries will have been checked on the master.

What if two simulaneous, valid changes to the same entry on two masters
produce a schema error when combined?  I haven't been tracking MMR -
does the entry end up with a schema error, or does MMR consider two
changes to the same entry a conflict and fail to replicate, or...?

-- 
Hallvard

Comment 9 ando@openldap.org 2008-11-08 18:58:07 UTC
h.b.furuseth@usit.uio.no wrote:
> hyc@symas.com writes:
>> IMO defaulting schemacheck off for replication is fine because
>> replicated entries will have been checked on the master.
> 
> What if two simulaneous, valid changes to the same entry on two masters
> produce a schema error when combined?  I haven't been tracking MMR -
> does the entry end up with a schema error, or does MMR consider two
> changes to the same entry a conflict and fail to replicate, or...?

AFAIK, the last entryCSN should win.  Something like:

          MM1             MM2

time 0   csn0            csn0           (same)

time 1   csn0+1    ->    -

time 2   -         <-    csn0+2

time 3   csn0+1,csn0+2   csn0+2,csn0+1  (one wins, I assume the latest)

At all times, each entry is sane.  The one that wins is sane, the one 
that loses will be replaced by the one that wins.

The reason for this ITS and other stuff that will come shortly is that 
I've been asked to audit MMR, by designing a suite of tests that check 
functionality and reliability of MMR under possibly reproducible 
conflict, concurrency and other critical conditions.

I'm highlighting a series of issues.  I won't post ITSes or other 
notices until I find out whether it's slapd's or my tests' fault.

p.


Ing. Pierangelo Masarati
OpenLDAP Core Team

SysNet s.r.l.
via Dossi, 8 - 27100 Pavia - ITALIA
http://www.sys-net.it
-----------------------------------
Office:  +39 02 23998309
Mobile:  +39 333 4963172
Fax:     +39 0382 476497
Email:   ando@sys-net.it
-----------------------------------

Comment 10 Quanah Gibson-Mount 2008-11-10 22:37:22 UTC
changed notes
changed state Test to Release
Comment 11 Quanah Gibson-Mount 2008-11-24 17:07:53 UTC
changed notes
changed state Release to Closed
Comment 12 OpenLDAP project 2014-08-01 21:04:18 UTC
fixed in HEAD (confirmed)
fixed in RE24