Marantz, Roy wrote:
Those files plus various header files don't seem to correspond to what is being returned, but as I would expect, to various internal representations of the contextCSN.
contextCSN: 20080304184021.024760Z#000000#001#000000 Seems to be a date and timestamp, YYYYmmDDhhMMss.partOfSecond, followed by ???, then the rid, then ???.
From the code and struct definitions I would have expected the to see a
sid and some state indicator too.
You're thinking about this too hard.
Use ldapsearch to retrieve the contextCSN attributes from all of the servers. If they match, they are in sync. If not, then not. That *is* the state indicator.
Is there something I can query, like contextCSN, to indicate the last time syncrepl successfully finished resyncing the particular
database?
Any other way to do this or am I just trying to do something that is impossible?
See:
http://www.openldap.org/doc/admin24/replication.html#Syncrepl%20Details
"The consumer also stores its replica state, which is the provider's contextCSN received as a synchronization cookie, in the contextCSN attribute of the suffix entry. The replica state maintained by a consumer server is used as the synchronization state indicator when it performs subsequent incremental synchronization with the provider server. It is also used as a provider-side synchronization state indicator when it functions as a secondary provider server in a cascading replication configuration. Since the consumer and provider state information are maintained in the same location within their respective databases, any consumer can be promoted to a provider (and vice versa) without any special actions."
And more detail at:
http://www.rfc-editor.org/rfc/rfc4533.txt
For example:
[ghenry@suretec-master admin]$ ldapsearch -x -H ldap://127.0.0.1 -s 'base' contextCSN # extended LDIF # # LDAPv3 # base<dc=suretecsystems, dc=com> (default) with scope baseObject # filter: (objectclass=*) # requesting: contextCSN #
# suretecsystems.com dn: dc=suretecsystems,dc=com contextCSN: 20080228163422.801358Z#000000#000#000000
# search result search: 2 result: 0 Success
# numResponses: 2 # numEntries: 1 [ghenry@suretec-slave admin]$ ldapsearch -x -H ldap://127.0.0.1 -s 'base' contextCSN # extended LDIF # # LDAPv3 # base<dc=suretecsystems, dc=com> (default) with scope baseObject # filter: (objectclass=*) # requesting: contextCSN #
# suretecsystems.com dn: dc=suretecsystems,dc=com contextCSN: 20080228163422.801358Z#000000#000#000000
# search result search: 2 result: 0 Success
# numResponses: 2 # numEntries: 1