On Mon, Dec 3, 2012 at 9:47 PM, Emmanuel Lécharny <elecharny@gmail.com> wrote:
Hi,

here is an exemple of logs I get now when running replication. This is a
scenario where I start a consumer, then a producer, then I stop the
producer. As expected, the consumer cannot connect to the producer at
first, then connects, then detect the disconnection.

There are a few improvements I want to work on now, like dumping the
cookie as a string in any case, improve the IntermediateResponse dump,
and also create a logger per consumer, or at least use MDC to b able to
follow one consumer in the logs.

good idea, we should inject the replica id into this(how??) to distinguish each consumer
All those logs are dumped into a dedicated logger, btw.


               _                     _          ____  ____
              / \   _ __    ___  ___| |__   ___|  _ \/ ___|
             / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \
            / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) |
           /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/
                   |_|

    [17:07:40] DEBUG [CONSUMER_LOG] - Configuring consumer [rid:0,
    base:'ou=system', filter:(objectClass=*), scope:sub,
    alias:NEVER_DEREF_ALIASES, chase referrals:false, attributes:{*},
    refresh:60000, MMR, provider:localhost:11389,
    user:'uid=admin,ou=system', TLS:false]
    [17:07:40] INFO [CONSUMER_LOG] - starting the replication consumer
    with Consumer [rid:0, base:'ou=system', filter:(objectClass=*),
    scope:sub, alias:NEVER_DEREF_ALIASES, chase referrals:false,
    attributes:{*}, refresh:60000, MMR, provider:localhost:11389,
    user:'uid=admin,ou=system', TLS:false]
               _                     _          _  __ ____   ___
              / \   _ __    ___  ___| |__   ___| |/ /|  _ \ / __|
             / _ \ | '_ \ / _` |/ __| '_ \ / _ \ ' / | | | / /
            / ___ \| |_) | (_| | (__| | | |  __/ . \ | |_| \ \__
           /_/   \_\ .__/ \__,_|\___|_| |_|\___|_|\_\|____/ \___|
                   |_|

    [17:08:14] ERROR [CONSUMER_LOG] - Failed to connect to the server
    localhost:11389, cause : Cannot connect on the server: Connection
    refused
    [17:08:14] ERROR
    [org.apache.directory.server.ldap.replication.consumer.ReplicationConsumerImpl]
    - Failed to connect to the server localhost:11389, cause : Cannot
    connect on the server: Connection refused
    [17:08:14] DEBUG [CONSUMER_LOG] - Consumer 0 cannot connect to
    localhost:11389, wait 5 seconds.
    [17:08:29] ERROR [CONSUMER_LOG] - Failed to connect to the server
    localhost:11389, cause : Cannot connect on the server: Connection
    refused
    [17:08:29] ERROR
    [org.apache.directory.server.ldap.replication.consumer.ReplicationConsumerImpl]
    - Failed to connect to the server localhost:11389, cause : Cannot
    connect on the server: Connection refused
    [17:08:29] DEBUG [CONSUMER_LOG] - Consumer 0 cannot connect to
    localhost:11389, wait 5 seconds.
    [17:08:34] INFO [CONSUMER_LOG] - Consumer 0 connected to
    producerlocalhost:11389
    [17:08:34] DEBUG [CONSUMER_LOG] - Starting the SyncRepl process for
    consumer 0
    [17:08:34] DEBUG [CONSUMER_LOG] - Cookie for consumer 0 :
    rid=009,csn=20121130171126.104000Z#000000#000#000000
    [17:08:34] DEBUG [CONSUMER_LOG] - Cookie read : '[114, 105, 100, 61,
    48, 48, 57, 44, 99, 115, 110, 61, 50, 48, 49, 50, 49, 49, 51, 48,
    49, 55, 49, 49, 50, 54, 46, 49, 48, 52, 48, 48, 48, 90, 35, 48, 48,
    48, 48, 48, 48, 35, 48, 48, 48, 35, 48, 48, 48, 48, 48, 48]'
    [17:08:34] DEBUG [CONSUMER_LOG] - Starting synchronization mode
    REFRESH_AND_PERSIST, reloadHint false
    [17:08:34] DEBUG [CONSUMER_LOG] - searching on localhost:11389 with
    searchRequest, cookie
    'rid=009,csn=20121130171126.104000Z#000000#000#000000'
    [17:08:34] DEBUG [CONSUMER_LOG] - Response from localhost:11389 :
    MessageType : INTERMEDIATE_RESPONSE
    Message ID : 2
        Intermediate Response
            Response name :'1.3.6.1.4.1.4203.1.9.1.4'
            ResponseValue :'0x80 0x34 0x72 0x69 0x64 0x3D 0x30 0x30 0x39
    0x2C 0x63 0x73 0x6E 0x3D 0x32 0x30 0x31 0x32 0x31 0x31 0x33 0x30
    0x31 0x37 0x31 0x31 0x32 0x36 0x2E 0x31 0x30 0x34 0x30 0x30 0x30
    0x5A 0x23 0x30 0x30 0x30 0x30 0x30 0x30 0x23 0x30 0x30 0x30 0x23
    0x30 0x30 0x30 0x30 0x30 0x30 '
            Ldap Result
                Result code : (SUCCESS) success
                Matched Dn : 'null'
                Diagnostic message : 'null'

    [17:08:34] DEBUG [CONSUMER_LOG] - setting the cookie from the sync
    info: rid=009,csn=20121130171126.104000Z#000000#000#000000
    [17:08:34] DEBUG [CONSUMER_LOG] - Storing the cookie
    'rid=009,csn=20121130171126.104000Z#000000#000#000000'
    [17:09:21] DEBUG [CONSUMER_LOG] - Consumer 0 session with
    localhost:11389 has been closed
    [17:09:21] DEBUG [CONSUMER_LOG] - Response from localhost:11389 :
    MessageType : SEARCH_RESULT_DONE
    Message ID : -1
        Search Result Done
            Ldap Result
                Result code : (PROTOCOL_ERROR) protocolError
                Matched Dn : 'null'
                Diagnostic message : 'PROTOCOL_ERROR: The server will
    disconnect!'

    [17:09:21] DEBUG [CONSUMER_LOG] - Search sync on localhost:11389 has
    been canceled
    [17:09:21] INFO [CONSUMER_LOG] - starting the replication consumer
    with Consumer [rid:0, base:'ou=system', filter:(objectClass=*),
    scope:sub, alias:NEVER_DEREF_ALIASES, chase referrals:false,
    attributes:{*}, refresh:60000, MMR, provider:localhost:11389,
    user:'uid=admin,ou=system', TLS:false]
    [17:09:48] ERROR [CONSUMER_LOG] - Failed to connect to the server
    localhost:11389, cause : Cannot connect on the server: Connection
    refused
    [17:09:48] ERROR
    [org.apache.directory.server.ldap.replication.consumer.ReplicationConsumerImpl]
    - Failed to connect to the server localhost:11389, cause : Cannot
    connect on the server: Connection refused
    [17:09:48] DEBUG [CONSUMER_LOG] - Consumer 0 cannot connect to
    localhost:11389, wait 5 seconds.

--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com




--
Kiran Ayyagari
http://keydap.com