[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: syncrepl error (53) with 3-way delta-mmr (consumer state is newer than provider)



On 08/30/2017 07:42 PM, Quanah Gibson-Mount wrote:
> This would generally indicate that the accesslog DB was empty at
> startup, and it generated a new CSN.  This is a general problem with
> delta-syncrepl -- If the accesslog DB goes empty, there are a host of
> issues that can ensue (See ITS#8100 for example).
I did not check the accesslog DB, but this must have been the case. I
saw in the logs that there were no writes during the last days on
ServerID 001 and 002. ServerID 000 had some writes, which should not
have been purged by:

olcAccessLogPurge: 1+00:00 0+01:00
>
> Generally you need a script that writes a change on all masters in
> your cluster on a regular interval so that the DB is never purged, and
> there is always an active contextCSN value that's stored in the DB for
> each serverID.
Thanks a lot for this information.

Below is what I did, in case somebody else needs this (the timestamp
could be used to monitor the syncrepl health).


schema:

dn: cn={5}dphys,cn=schema,cn=config
changetype: modify
add: olcAttributeTypes
olcAttributeTypes: ( 1.3.6.1.4.1.12530.10.1.1.7.1 NAME 'heartbeatServerID'
  DESC 'delta-syncrepl heartbeat server id (format: nnn)'
  EQUALITY caseExactMatch
  SUBSTR caseExactSubstringsMatch
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} )
olcAttributeTypes: ( 1.3.6.1.4.1.12530.10.1.1.7.2 NAME 'heartbeatTimestamp'
  DESC 'delta-syncrepl heartbeat timestamp (format: date -u --rfc-3339=ns)'
  EQUALITY caseExactMatch
  SUBSTR caseExactSubstringsMatch
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{255} )
-
add: olcObjectClasses
olcObjectClasses: ( 1.3.6.1.4.1.12530.10.1.1.8.1 NAME 'heartbeatEntry'
  DESC 'entry for delta-syncrepl transaction heartbeats'
  SUP top STRUCTURAL
  MUST ( cn $ heartbeatServerID )
  MAY heartbeatTimestamp )


database entry:

dn: ou=syncrepl,dc=phys,dc=ethz,dc=ch
changetype: add
objectClass: organizationalUnit
description: slapd syncrepl branch
ou: syncrepl

dn: ou=hb,ou=syncrepl,dc=phys,dc=ethz,dc=ch
changetype: add
objectClass: organizationalUnit
description: slapd delta-syncrepl heartbeat branch
ou: hb

dn: cn=phd-aa1,ou=hb,ou=syncrepl,dc=phys,dc=ethz,dc=ch
changetype: add
objectClass: heartbeatEntry
heartbeatServerID: 000
heartbeatTimestamp: 0000-00-00 00:00:00.000000000+00:00


script (run by cron):

#!/bin/bash
HOSTNAME="phd-aa1"
cat << EOF | /usr/bin/ldapmodify -Q -Y EXTERNAL -H ldapi://
dn: cn=${HOSTNAME},ou=hb,ou=syncrepl,dc=phys,dc=ethz,dc=ch
changetype: modify
replace: heartbeatTimestamp
heartbeatTimestamp: $(date -u --rfc-3339=ns)
EOF

-- 
Sven