Details
Description
CBL push replication is not replicating doc updates with delta sync after CBL upgrade.
This is what I'm trying to do in CBL upgrade test -
1. Migrate older-pre-built db to a provided cbl apps
2. Start the replication and replicate db to cluster
3. Running all query tests
4. Perform mutation operations
a. Add new docs and replicate to cluster
b. Update docs for migrated db and replicate to cluster <-- Failing here
c. Delete docs from migrated db and replicate to cluster
ERROR:
> assert "new_field" in sg_data, "Updated docs failed to get replicated"
E AssertionError: Updated docs failed to get replicated
E assert 'new_field' in {'_id': 'route_57637', '_rev': '1-53c9a41c517273c178023f50d4c22d82b2abca09', '_revisions':
, 'airline': 'UA', ...}
Code Snippet:
# updating old docs
|
repl_config = replicator.configure(cbl_db, sg_blip_url, replication_type="push",
|
continuous=True, replicator_authenticator=replicator_authenticator)
|
repl = replicator.create(repl_config)
|
doc_ids_to_update = random.sample(cbl_doc_ids, 5)
|
docs = db.getDocuments(cbl_db, doc_ids_to_update)
|
for doc_id in docs:
|
log_info("Updating CBL Doc - {}".format(doc_id))
|
data = docs[doc_id]
|
data["new_field"] = "test_string_for_{}".format(doc_id)
|
db.updateDocument(cbl_db, doc_id=doc_id, data=data)
|
|
replicator.start(repl)
|
replicator.wait_until_replicator_idle(repl)
|
replicator.stop(repl)
|
|
cbs_docs = sg_client.get_all_docs(sg_admin_url, sg_db, session)["rows"]
|
cbs_doc_ids = [doc["id"] for doc in cbs_docs]
|
|
for doc_id in doc_ids_to_update:
|
log_info("Checking for updates in doc on CBS: {}".format(doc_id))
|
sg_data = sg_client.get_doc(url=sg_admin_url, db=sg_db, doc_id=doc_id, auth=session)
|
assert "new_field" in sg_data, "Updated docs failed to get replicated"
|
new_cbl_doc_ids = db.getDocIds(cbl_db, limit=40000)
|
Command to run test -
pytest -s --timeout 3600 --base-liteserv-version=2.5.0 --upgraded-liteserv-version=2.6.0-141 --liteserv-host=10.100.174.204 --liteserv-port=8080 --liteserv-platform=ios --xattrs --skip-provisioning --no-conflicts --enable-file-logging --encrypted-db --delta-sync --encrypted-db-password=password --sync-gateway-version=2.5.1-11 --mode=cc --server-version=6.0.1-2037 testsuites/CBLTester/upgrade_tests/test_cbl_upgrade.py -k test_upgrade_cbl
Test is passing without --delta-sync.
Jenkins job for this test will give a detailed look into the test flow - http://uberjenkins.sc.couchbase.com:8080/view/03%20CBL-2.x/job/CBL_upgrade/42/console
PS: Tested only on iOS, will update status about other platform later.