weixin_39904116
weixin_39904116
2020-12-28 08:49

complete uncertainty in doc versions on SG, CBlite and CB when doc has been changed on CB

this test is a part of my integration tests for SG, CBlite and cb + sdk(based language is java) steps: 1) create doc in couchbase lite(my code build based on couchbase-lite-java-core & couchbase-lite-java 1.0.4 version) 2) run sg with config file:


{
   "_comment": "curl -X PUT localhost:4985/sync_gateway/_user/GUEST --data '{\"disabled\":false, \"admin_channels\":[\"public\"]}'",
   "interface":":4984",
   "adminInterface":":4985",
   "log":["REST"],
   "databases":{
      "sync_gateway":{
         "server":"http://localhost:8091",
         "bucket":"db",
         "sync":`function(doc) {channel(doc.channels);}`,
         "users": { "GUEST": {"disabled": false, "admin_channels": ["*"] } } 
      }
   }
}

3) run continues pull-push replication:


        Replication replicationPush = database.createPushReplication(new URL(
                "http://127.0.0.1:4984/sync_gateway"));
        replicationPush.setContinuous(true);

        Replication replicationPull = database.createPullReplication(new URL(
                "http://127.0.0.1:4984/sync_gateway"));
        replicationPull.setContinuous(true);
        replicationPush.setContinuous(true);
        replicationPush.start();
        replicationPull.start();

4) change the same doc on CB server like:


        for (Document doc : docs) {
            JsonDocument cbdoc = JsonDocument.create(doc.getId(), null);
            JsonDocument cbResponse = bucket.upsert(cbdoc);
            Assert.assertNotNull(cbResponse);

        }

5)verify the doc on a) CB contains expected modified doc(with revision 2) b) This document is not present anymore in SG: INFO: CBLite: {"rows":[ ], "total_rows":0,"update_seq":2} 3) CBLite still has the old version:

INFO: CBLite: Currennt revision on CBLite 2d383684-8c8b-498e-a306-2b876ced2245: 1-7fb92469b981a2b083ce448257f7da7d

my java code:


public void changeDocOnCB() throws JSchException, IOException,
            SftpException, CouchbaseLiteException {
        RemoteExecutor re = new RemoteExecutor("localhost", "andrei",
                "XX");

        List<document> docs = LiteHelper.createDocuments(database, 1);

        SGHelper.killAllSG(re);
        SGHelper.runSG(re,
                "/home/andrei/couchbase_src/sync_gateway/bin/sync_gateway",
                "src/main/java/sg_config.conf");

        Replication replicationPush = database.createPushReplication(new URL(
                "http://127.0.0.1:4984/sync_gateway"));
        replicationPush.setContinuous(true);

        Replication replicationPull = database.createPullReplication(new URL(
                "http://127.0.0.1:4984/sync_gateway"));
        replicationPull.setContinuous(true);
        replicationPush.setContinuous(true);
        replicationPush.start();
        replicationPull.start();

        Query queryAllDocs = database.createAllDocumentsQuery();
        QueryEnumerator queryEnumerator = queryAllDocs.run();
        Assert.assertEquals(1, queryEnumerator.getCount());

        for (Document doc : docs) {
            JsonDocument cbdoc = JsonDocument.create(doc.getId(), null);
            JsonDocument cbResponse = bucket.upsert(cbdoc);
            Assert.assertNotNull(cbResponse);

        }

        queryAllDocs = database.createAllDocumentsQuery();
        queryEnumerator = queryAllDocs.run();
        Assert.assertEquals(1, queryEnumerator.getCount());
        for (Iterator<queryrow> it = queryEnumerator; it.hasNext();) {
            QueryRow row = it.next();
            Log.i(Log.TAG, "Currennt revision on CBLite "
                    + row.getDocument().getId() + ": "
                    + row.getDocument().getCurrentRevisionId());
        }

        RestClient rc = new RestClient(
                "http://127.0.0.1:4984/sync_gateway/_all_docs");

        Log.i(Log.TAG, rc.getResponse() + "");

    }
</queryrow></document>

and test output:


SEVERE: CBLite: Cannot parse version code: 
SEVERE: CBLite: Cannot parse version code: 
INFO: CBLite: Starting Manager version: 1.0.4--1
WARNING: CBLite: mustExist is true and db (integration-test) does not exist
INFO: CBLite: POST http://localhost:8091/pools/default/buckets returned a response status of 202 Accepted
Feb 16, 2015 8:57:06 PM com.couchbase.client.core.CouchbaseCore <init>
INFO: CoreEnvironment: {sslEnabled=false, sslKeystoreFile='null', sslKeystorePassword='null', queryEnabled=false, queryPort=8093, bootstrapHttpEnabled=true, bootstrapCarrierEnabled=true, bootstrapHttpDirectPort=8091, bootstrapHttpSslPort=18091, bootstrapCarrierDirectPort=11210, bootstrapCarrierSslPort=11207, ioPoolSize=8, computationPoolSize=8, responseBufferSize=16384, requestBufferSize=16384, kvServiceEndpoints=1, viewServiceEndpoints=1, queryServiceEndpoints=1, ioPool=NioEventLoopGroup, coreScheduler=CoreScheduler, packageNameAndVersion=couchbase-java-client/2.0.3 (git: 2.0.3)}
Feb 16, 2015 8:57:07 PM com.couchbase.client.core.node.CouchbaseNode$5 call
INFO: Connected to Node localhost
Feb 16, 2015 8:57:07 PM com.couchbase.client.core.config.DefaultConfigurationProvider$6 call
INFO: Opened bucket db
INFO: CBLite: Connected to localhost via ssh
INFO: CBLite: main Begin transaction (level 1)
INFO: CBLite: main Committing transaction (level 1)
INFO: CBLite: run on localhost: killall sync_gateway
sync_gateway: no process found
INFO: CBLite: exit-status: 1
INFO: CBLite: will create on localhost file: /tmp/sg_config.conf
INFO: CBLite: run on localhost: /home/andrei/couchbase_src/sync_gateway/bin/sync_gateway /tmp/sg_config.conf
20:57:11.580123 Enabling logging: [REST]
20:57:11.580160 ==== Couchbase Sync Gateway/master(aa82177+CHANGES) ====
20:57:11.580253 Configured Go to use all 8 CPUs; setenv GOMAXPROCS to override this
20:57:11.580288 Opening db /sync_gateway as bucket "db", pool "default", server <http:>
20:57:11.580348 Opening Couchbase database db on <http:>
20:57:12.178873     Reset guest user to config
20:57:12.178888 Starting admin server on :4985
20:57:12.182927 Starting server on :4984 ...
FINE: Sync: firing trigger: START
FINE: Sync: entered the RUNNING state, calling start()
FINER: Sync: com.couchbase.lite.support.RemoteRequestRetry: RemoteRequestRetry created, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
Feb 16, 2015 8:57:14 PM com.couchbase.lite.util.SystemLogger v
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest created, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINE: Sync: called start(), calling notifyChangeListenersStateTransition
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest run() called, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINE: Sync: State transition: INITIAL -> RUNNING (via START).  this: com.couchbase.lite.replicator.PusherInternal
FINE: Sync: called notifyChangeListenersStateTransition
FINE: Sync: firing trigger: START
FINE: Sync: entered the RUNNING state, calling start()
FINER: Sync: com.couchbase.lite.support.RemoteRequestRetry: RemoteRequestRetry created, url: http://127.0.0.1:4984/sync_gateway/_local/c6f1f2f0aadcd3e5cfcad2e9d43ec1ce73bf82c2
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest created, url: http://127.0.0.1:4984/sync_gateway/_local/c6f1f2f0aadcd3e5cfcad2e9d43ec1ce73bf82c2
FINE: Sync: called start(), calling notifyChangeListenersStateTransition
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest run() called, url: http://127.0.0.1:4984/sync_gateway/_local/c6f1f2f0aadcd3e5cfcad2e9d43ec1ce73bf82c2
FINE: Sync: State transition: INITIAL -> RUNNING (via START).  this: com.couchbase.lite.replicator.PullerInternal
FINE: Sync: called notifyChangeListenersStateTransition
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest calling httpClient.execute, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest calling httpClient.execute, url: http://127.0.0.1:4984/sync_gateway/_local/c6f1f2f0aadcd3e5cfcad2e9d43ec1ce73bf82c2
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest calling httpClient.execute, client: org.apache.http.impl.client.DefaultHttpClient url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest calling httpClient.execute, client: org.apache.http.impl.client.DefaultHttpClient url: http://127.0.0.1:4984/sync_gateway/_local/c6f1f2f0aadcd3e5cfcad2e9d43ec1ce73bf82c2
2015/02/16 20:57:15 go-couchbase: call to ViewCustom("sync_gateway", "access") in github.com/couchbaselabs/sync_gateway/db.(*DatabaseContext).ComputeChannelsForPrincipal took 321.713028ms
2015/02/16 20:57:15 go-couchbase: call to ViewCustom("sync_gateway", "access") in github.com/couchbaselabs/sync_gateway/db.(*DatabaseContext).ComputeChannelsForPrincipal took 338.549024ms
20:57:15.185898 HTTP:  #001: GET /sync_gateway/_local/c6f1f2f0aadcd3e5cfcad2e9d43ec1ce73bf82c2
20:57:15.186030 HTTP: #001:     --> 404 missing  (397.3 ms)
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest called httpClient.execute, url: http://127.0.0.1:4984/sync_gateway/_local/c6f1f2f0aadcd3e5cfcad2e9d43ec1ce73bf82c2
FINER: Sync: serverVersion: Couchbase Sync Gateway/unofficial
FINE: Sync: com.couchbase.lite.support.RemoteRequestRetry$1: RemoteRequestRetry inner request finished, url: http://127.0.0.1:4984/sync_gateway/_local/c6f1f2f0aadcd3e5cfcad2e9d43ec1ce73bf82c2
FINE: Sync: com.couchbase.lite.support.RemoteRequestRetry: isTransientError called, httpResponse: org.apache.http.message.BasicHttpResponse e: org.apache.http.client.HttpResponseException: Not Found
FINE: Sync: %s: return false
FINE: Sync: com.couchbase.lite.support.RemoteRequestRetry$1: RemoteRequestRetry failed, non-transient error.  NOT retrying. url: http://127.0.0.1:4984/sync_gateway/_local/c6f1f2f0aadcd3e5cfcad2e9d43ec1ce73bf82c2
FINER: Sync: com.couchbase.lite.replicator.ReplicationInternal$9: Remote checkpoint does not exist on server yet: c6f1f2f0aadcd3e5cfcad2e9d43ec1ce73bf82c2
FINE: Sync: com.couchbase.lite.replicator.ReplicationInternal$9: lastSequence mismatch: I had: null, remote had: null
FINE: Sync: startReplicating()
WARNING: Sync: com.couchbase.lite.replicator.PullerInternal: starting ChangeTracker with since=null mode=OneShot
WARNING: Sync: com.couchbase.lite.replicator.PullerInternal: started ChangeTracker com.couchbase.lite.replicator.ChangeTracker
FINE: ChangeTracker: com.couchbase.lite.replicator.ChangeTracker: Changed tracker asked to start
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest finally block.  url: http://127.0.0.1:4984/sync_gateway/_local/c6f1f2f0aadcd3e5cfcad2e9d43ec1ce73bf82c2
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest run() finished, url: http://127.0.0.1:4984/sync_gateway/_local/c6f1f2f0aadcd3e5cfcad2e9d43ec1ce73bf82c2
FINER: ChangeTracker: com.couchbase.lite.replicator.ChangeTracker: Making request to http://127.0.0.1:4984/sync_gateway/_changes
20:57:15.211192 HTTP:  #003: POST /sync_gateway/_changes
FINER: ChangeTracker: com.couchbase.lite.replicator.ChangeTracker: got response. status: HTTP/1.1 200 OK mode: OneShot
FINER: ChangeTracker: com.couchbase.lite.replicator.ChangeTracker: /entity.getContent().  mode: OneShot
FINER: ChangeTracker: com.couchbase.lite.replicator.ChangeTracker: readValue (oneshot)
FINE: ChangeTracker: com.couchbase.lite.replicator.ChangeTracker: changeTrackerReceivedChange: {seq=1, id=_user/GUEST, changes=[]}
FINE: ChangeTracker: com.couchbase.lite.replicator.ChangeTracker: /changeTrackerReceivedChange: {seq=1, id=_user/GUEST, changes=[]}
FINE: Sync: changeTrackerReceivedChange: {seq=1, id=_user/GUEST, changes=[]}
FINER: ChangeTracker: com.couchbase.lite.replicator.ChangeTracker: /readValue (oneshot)
WARNING: Sync: com.couchbase.lite.replicator.PullerInternal: Received invalid doc ID from _changes: {seq=1, id=_user/GUEST, changes=[]}
FINE: Sync: changeTrackerCaughtUp
FINE: Sync: batcher.waitForPendingFutures()
FINE: Batcher: com.couchbase.lite.support.Batcher: waitForPendingFutures
FINER: ChangeTracker: com.couchbase.lite.replicator.ChangeTracker: Making request to http://127.0.0.1:4984/sync_gateway/_changes
FINE: Batcher: com.couchbase.lite.support.Batcher: /waitForPendingFutures
FINE: Sync: waitForPendingFutures()
20:57:15.227871 HTTP:  #004: POST /sync_gateway/_changes
FINE: Sync: calling future.get() on com.couchbase.lite.support.RemoteRequestRetry
FINE: Sync: done calling future.get() on com.couchbase.lite.support.RemoteRequestRetry
FINE: Sync: downloadsToInsert.waitForPendingFutures()
FINE: Batcher: com.couchbase.lite.support.Batcher: waitForPendingFutures
FINE: Batcher: com.couchbase.lite.support.Batcher: /waitForPendingFutures
SEVERE: Sync: PullerInternal stopGraceful.run() finished
FINE: Sync: firing trigger: WAITING_FOR_CHANGES
FINE: Sync: State transition: RUNNING -> IDLE (via WAITING_FOR_CHANGES).  this: com.couchbase.lite.replicator.PullerInternal
FINER: ChangeTracker: com.couchbase.lite.replicator.ChangeTracker: got response. status: HTTP/1.1 200 OK mode: LongPoll
FINER: ChangeTracker: com.couchbase.lite.replicator.ChangeTracker: /entity.getContent().  mode: LongPoll
FINER: ChangeTracker: com.couchbase.lite.replicator.ChangeTracker: readValue
20:57:15.261465 HTTP:  #002: GET /sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
20:57:15.261565 HTTP: #002:     --> 404 missing  (472.8 ms)
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest called httpClient.execute, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINER: Sync: serverVersion: Couchbase Sync Gateway/unofficial
FINE: Sync: com.couchbase.lite.support.RemoteRequestRetry$1: RemoteRequestRetry inner request finished, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINE: Sync: com.couchbase.lite.support.RemoteRequestRetry: isTransientError called, httpResponse: org.apache.http.message.BasicHttpResponse e: org.apache.http.client.HttpResponseException: Not Found
FINE: Sync: %s: return false
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger d
FINE: Sync: com.couchbase.lite.support.RemoteRequestRetry$1: RemoteRequestRetry failed, non-transient error.  NOT retrying. url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger v
FINER: Sync: com.couchbase.lite.replicator.ReplicationInternal$9: Remote checkpoint does not exist on server yet: 00f78bfd47315247a61f94b858464bab7d7e206a
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger d
FINE: Sync: com.couchbase.lite.replicator.ReplicationInternal$9: lastSequence mismatch: I had: null, remote had: null
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger d
FINE: Sync: com.couchbase.lite.replicator.PusherInternal: beginReplicating() called
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger w
WARNING: Sync: Error converting lastSequence: null to long.  Using 0
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger d
FINE: Sync: com.couchbase.lite.replicator.PusherInternal: Getting changes since null
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger d
FINE: Sync: com.couchbase.lite.replicator.PusherInternal: Queuing 1 changes since null
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger v
FINER: Batcher: com.couchbase.lite.support.Batcher: queueObjects called with 1 objects. Thread: Thread[CBLRequestWorker-00f78-0,5,main]
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger v
FINER: Batcher: com.couchbase.lite.support.Batcher: inbox size before adding objects: 0
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger v
FINER: Batcher: com.couchbase.lite.support.Batcher: calling scheduleWithDelay(500)
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger v
FINER: Batcher: com.couchbase.lite.support.Batcher: scheduleWithDelay called with delayMs: 500 ms
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger v
FINER: Batcher: workExecutor.schedule() with delayMs: 500 ms
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger v
FINER: Batcher: com.couchbase.lite.support.Batcher: created future: java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask
FINER: Batcher: com.couchbase.lite.support.Batcher: scheduleWithDelay already has a pending task: java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask. ignoring.
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest finally block.  url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINE: Sync: batcher.waitForPendingFutures()
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest run() finished, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINE: Batcher: com.couchbase.lite.support.Batcher: waitForPendingFutures
FINE: Batcher: calling future.get() on java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask
FINER: Batcher: com.couchbase.lite.support.Batcher: processNow() called
FINER: Batcher: com.couchbase.lite.support.Batcher: inbox.size() <= capacity, adding 1 items from inbox -> toProcess
FINER: Batcher: com.couchbase.lite.support.Batcher: invoking processor com.couchbase.lite.replicator.ReplicationInternal$2 with 1 items 
FINER: Sync: *** com.couchbase.lite.replicator.ReplicationInternal$2: BEGIN processInbox (1 sequences)
FINER: Sync: com.couchbase.lite.replicator.PusherInternal: posting to /_revs_diff
FINER: Sync: com.couchbase.lite.support.RemoteRequestRetry: RemoteRequestRetry created, url: http://127.0.0.1:4984/sync_gateway/_revs_diff
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest created, url: http://127.0.0.1:4984/sync_gateway/_revs_diff
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest run() called, url: http://127.0.0.1:4984/sync_gateway/_revs_diff
FINER: Sync: *** com.couchbase.lite.replicator.ReplicationInternal$2: END processInbox (lastSequence=null)
FINER: Sync: com.couchbase.lite.replicator.ReplicationInternal$2: batcher calling updateActive()
FINER: Sync: com.couchbase.lite.replicator.PusherInternal: updateActive() called
FINE: Batcher: done calling future.get() on java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask
FINE: Batcher: com.couchbase.lite.support.Batcher: /waitForPendingFutures
FINE: Sync: /batcher.waitForPendingFutures()
FINE: Sync: calling future.get() on com.couchbase.lite.support.RemoteRequestRetry
FINE: Sync: done calling future.get() on com.couchbase.lite.support.RemoteRequestRetry
FINE: Sync: calling future.get() on com.couchbase.lite.support.RemoteRequestRetry
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest calling httpClient.execute, url: http://127.0.0.1:4984/sync_gateway/_revs_diff
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest calling httpClient.execute, client: org.apache.http.impl.client.DefaultHttpClient url: http://127.0.0.1:4984/sync_gateway/_revs_diff
20:57:15.790237 HTTP:  #005: POST /sync_gateway/_revs_diff
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest called httpClient.execute, url: http://127.0.0.1:4984/sync_gateway/_revs_diff
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest finally block.  url: http://127.0.0.1:4984/sync_gateway/_revs_diff
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest calling respondWithResult.  url: http://127.0.0.1:4984/sync_gateway/_revs_diff, error: null
FINE: Sync: com.couchbase.lite.support.RemoteRequestRetry$1: RemoteRequestRetry inner request finished, url: http://127.0.0.1:4984/sync_gateway/_revs_diff
FINE: Sync: com.couchbase.lite.support.RemoteRequestRetry$1: RemoteRequestRetry was successful, calling callback url: http://127.0.0.1:4984/sync_gateway/_revs_diff
FINER: Sync: com.couchbase.lite.replicator.PusherInternal$4: got /_revs_diff response
FINER: Sync: com.couchbase.lite.replicator.PusherInternal: POSTing 1 revisions to _bulk_docs: [{_rev=1-7fb92469b981a2b083ce448257f7da7d, testName=testDatabase, _id=2d383684-8c8b-498e-a306-2b876ced2245, _revisions={start=1, ids=[7fb92469b981a2b083ce448257f7da7d]}, sequence=0}]
FINER: Sync: com.couchbase.lite.replicator.PusherInternal: Incrementing changesCount count from 0 by adding 1 -> 1
FINER: Sync: com.couchbase.lite.support.RemoteRequestRetry: RemoteRequestRetry created, url: http://127.0.0.1:4984/sync_gateway/_bulk_docs
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest created, url: http://127.0.0.1:4984/sync_gateway/_bulk_docs
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest run() called, url: http://127.0.0.1:4984/sync_gateway/_bulk_docs
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest run() finished, url: http://127.0.0.1:4984/sync_gateway/_revs_diff
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest calling httpClient.execute, url: http://127.0.0.1:4984/sync_gateway/_bulk_docs
FINE: Sync: done calling future.get() on com.couchbase.lite.support.RemoteRequestRetry
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest calling httpClient.execute, client: org.apache.http.impl.client.DefaultHttpClient url: http://127.0.0.1:4984/sync_gateway/_bulk_docs
FINE: Sync: calling future.get() on com.couchbase.lite.support.RemoteRequestRetry
20:57:15.812452 HTTP:  #006: POST /sync_gateway/_bulk_docs
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest called httpClient.execute, url: http://127.0.0.1:4984/sync_gateway/_bulk_docs
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest finally block.  url: http://127.0.0.1:4984/sync_gateway/_bulk_docs
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest calling respondWithResult.  url: http://127.0.0.1:4984/sync_gateway/_bulk_docs, error: null
FINE: Sync: com.couchbase.lite.support.RemoteRequestRetry$1: RemoteRequestRetry inner request finished, url: http://127.0.0.1:4984/sync_gateway/_bulk_docs
FINE: Sync: com.couchbase.lite.support.RemoteRequestRetry$1: RemoteRequestRetry was successful, calling callback url: http://127.0.0.1:4984/sync_gateway/_bulk_docs
FINER: Sync: com.couchbase.lite.replicator.PusherInternal: Setting lastSequence to 1 from(null)
FINE: Sync: com.couchbase.lite.replicator.PusherInternal: saveLastSequence() called. lastSequence: 1 remoteCheckpoint: null
FINE: Sync: com.couchbase.lite.replicator.PusherInternal: start put remote _local document.  checkpointID: 00f78bfd47315247a61f94b858464bab7d7e206a body: {lastSequence=1}
FINER: Sync: com.couchbase.lite.support.RemoteRequestRetry: RemoteRequestRetry created, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest created, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest run() called, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINER: Sync: com.couchbase.lite.replicator.PusherInternal: POSTed to _bulk_docs
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest calling httpClient.execute, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINER: Sync: com.couchbase.lite.replicator.PusherInternal: Incrementing completedChangesCount count from 0 by adding 1 -> 1
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest calling httpClient.execute, client: org.apache.http.impl.client.DefaultHttpClient url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger v
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest run() finished, url: http://127.0.0.1:4984/sync_gateway/_bulk_docs
FINE: Sync: done calling future.get() on com.couchbase.lite.support.RemoteRequestRetry
FINE: Sync: calling future.get() on com.couchbase.lite.support.RemoteRequestRetry
20:57:15.870704 HTTP:  #007: PUT /sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest called httpClient.execute, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
Feb 16, 2015 8:57:15 PM com.couchbase.lite.util.SystemLogger v
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest finally block.  url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest calling respondWithResult.  url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a, error: null
FINE: Sync: com.couchbase.lite.support.RemoteRequestRetry$1: RemoteRequestRetry inner request finished, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINE: Sync: com.couchbase.lite.support.RemoteRequestRetry$1: RemoteRequestRetry was successful, calling callback url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINE: Sync: com.couchbase.lite.replicator.ReplicationInternal$7: put remote _local document request finished.  checkpointID: 00f78bfd47315247a61f94b858464bab7d7e206a body: {lastSequence=1}
FINE: Sync: com.couchbase.lite.replicator.ReplicationInternal$7: saved remote checkpoint, updating local checkpoint.  remoteCheckpoint: {_rev=0-1, lastSequence=1}
FINER: CBLite: com.couchbase.lite.Database[/home/andrei/MY/mobfunc/couchbaselitetest/test/integration-test.cblite]: setLastSequence() called with lastSequence: 1 checkpointId: 00f78bfd47315247a61f94b858464bab7d7e206a
FINER: Sync: com.couchbase.lite.support.RemoteRequest: RemoteRequest run() finished, url: http://127.0.0.1:4984/sync_gateway/_local/00f78bfd47315247a61f94b858464bab7d7e206a
FINE: Sync: done calling future.get() on com.couchbase.lite.support.RemoteRequestRetry
FINE: Sync: batcher.waitForPendingFutures()
FINE: Batcher: com.couchbase.lite.support.Batcher: waitForPendingFutures
FINE: Batcher: com.couchbase.lite.support.Batcher: /waitForPendingFutures
FINE: Sync: /batcher.waitForPendingFutures()
FINE: Sync: firing trigger: WAITING_FOR_CHANGES
FINE: Sync: State transition: RUNNING -> IDLE (via WAITING_FOR_CHANGES).  this: com.couchbase.lite.replicator.PusherInternal
FINE: CBLite: Query view null completed in 3 milliseconds
20:58:34.105478 HTTP:  #008: GET /sync_gateway/_all_docs  (ADMIN)
2015/02/16 20:58:34 go-couchbase: call to ViewCustom("sync_housekeeping", "all_docs") in github.com/couchbaselabs/sync_gateway/db.(*Database).ForEachDocID took 328.643309ms
20:58:34.583245 HTTP:  #009: GET /favicon.ico/  (ADMIN)
20:58:34.583285 HTTP: #009:     --> 400 invalid database name "favicon.ico"  (0.1 ms)
FINE: CBLite: Query view null completed in 2 milliseconds
INFO: CBLite: Currennt revision on CBLite 2d383684-8c8b-498e-a306-2b876ced2245: 1-7fb92469b981a2b083ce448257f7da7d
20:58:58.755641 HTTP:  #010: GET /sync_gateway/_all_docs
Feb 16, 2015 8:58:58 PM com.couchbase.lite.util.SystemLogger i
INFO: CBLite: {"rows":[
],
"total_rows":0,"update_seq":2}
</http:></http:></init>

该提问来源于开源项目:couchbase/sync_gateway

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

8条回答

  • weixin_39872191 weixin_39872191 4月前

    I don't understand this ticket. What is actual vs. expected?

    点赞 评论 复制链接分享
  • weixin_39775577 weixin_39775577 4月前

    is this testing bucket shadowing? Your config in step 2 suggests it's not. If you indeed aren't testing bucket shadowing, then this is a non-supported use case. Bucket shadowing is used in this scenario.

    点赞 评论 复制链接分享
  • weixin_39904116 weixin_39904116 4月前

    sorry, guys. my steps were a little wrong, could you check the corrected 2 & 3 steps. I'm not using bucket shadowing there.

    点赞 评论 复制链接分享
  • weixin_39966644 weixin_39966644 4月前

    If you're not doing any bucket shadowing, step (4) is invalid - docs in a sync gateway bucket should only be updated using sync gateway.

    点赞 评论 复制链接分享
  • weixin_39904116 weixin_39904116 4月前

    Hi , in step 4 I update doc on CB server via java cb sdk. so, before step4 cb lite, sg and cb have the same doc. in step4 I modify the doc on CB(I think that this step is quite valid) and then verify the doc in sg and cb lite

    on SG: curl http://localhost:4985/sync_gateway/2d383684-8c8b-498e-a306-2b876ced2245 {"error":"not_found","reason":"Not imported"}

    cb lite contains initial doc version

    点赞 评论 复制链接分享
  • weixin_39966644 weixin_39966644 4月前

    No, it's not valid to update the document directly using the CB API - the update won't have the required metadata used by SG for synchronization (which is why you're not seeing the update on the client).

    More details in the last paragraph of this page: http://developer.couchbase.com/mobile/develop/guides/sync-gateway/getting-started-with-sync-gateway/connecting-sync-gateway-to-couchbase-server/index.html

    点赞 评论 复制链接分享
  • weixin_39904116 weixin_39904116 4月前

    I understand what you mean. I would call this a valid negative test. I do not expect that after I change doc on cb with _invalid metadata I get the same doc on cblite/SG. My question is why cblite and SG return different results when I request this doc.

    I can extend the same test with further steps: input data: cbile still has doc with initial version ( rev_id =1-) sg returns {"error":"not_found","reason":"Not imported"} for doc with the same id cb has updated doc with not_sg metadata

    1)update the doc in cb lite

    result: cbile still has doc with new revision ( rev_id =2-) sg still returns {"error":"not_found","reason":"Not imported"} cb has updated doc with not_sg metadata

    it means that we will never be able to synchronize doc with this id from cb lite with CB?

    if it's so and mention of it here http://developer.couchbase.com/mobile/develop/guides/sync-gateway/getting-started-with-sync-gateway/connecting-sync-gateway-to-couchbase-server/index.html is enough then we can close the ticket and adopt my 'negative' test according to this limitation.

    "Note:Do not add, modify or remove data in the bucket using Couchbase APIs or the admin UI"

    点赞 评论 复制链接分享
  • weixin_39775577 weixin_39775577 4月前

    "it means that we will never be able to synchronize doc with this id from cb lite with CB?"

    Correct, . The metadata that SG needs was not properly updated. In addition, the sync function never ran on that revision, which leads to many other problems.

    点赞 评论 复制链接分享

相关推荐