Skip to content

Conversation

velicuvlad
Copy link

@velicuvlad velicuvlad commented Sep 23, 2025

https://jira.issues.couchbase.com/browse/CBL-7447

  • Updated to use the default collection where inly database was specified.
  • Updated to use LogSinks API instead of the old log API.
  • Converted value between maxRotateCount and maxKeptFiles (maxRotateCount = maxKeptFiles - 1).
  • Updated to use default collection with CollectionConfiguration when creating ReplicatorConfiguration with database.
  • Changed ReplicatorConfiguration setters handlers to ask and return CollectionConfiguration where the specific settings have now moved under CollectionConfiguration: conflictResolver, push/pull filter, channels, documentIDs

@velicuvlad
Copy link
Author

@velicuvlad
Copy link
Author

Tests will need to be changed slightly for calls such as replicatorConfiguration_set... because now it expects and returns a CollectionConfiguration, instead of ReplicatorConfiguration.

I think it would be more readable if that change happens in tests rather than trying to figure out what to return from an entire ReplicatorConfiguration as it can have multiple, different CollectionConfig inside. I've given a thought on this and, without having the same set of collections with the same config for all or a singular collection, for every test, I don't know what would have to be returned from those calls.

@velicuvlad velicuvlad requested a review from pasin September 24, 2025 21:07

case "replicatorConfiguration_setChannels":
var replicatorConfiguration: ReplicatorConfiguration = args.get(name: "configuration")!
var colConfiguration: CollectionConfiguration = args.get(name: "configuration")!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work as the returned value is ReplicatorConfiguration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no way around this as the collections need to be configured upfront.

@sanjivanipatrax @barkha06 how may tests that use these two apis?

replicatorConfiguration_setChannels
replicatorConfiguration_setDocumentIDs

It needs to change to use replicatorConfiguration_configureCollection with the default collection.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pasin None of the tests use those APIs

config.documentIDs = documentIDs
return config

case "replicatorConfiguration_addCollection":
Copy link
Contributor

@pasin pasin Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any python tests that use this need to be changed to use replicatorConfiguration_configureCollection

@sanjivanipatrax @barkha06

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API is also not used @pasin


case "replicatorConfiguration_setDocumentIDs":
var replicatorConfiguration: ReplicatorConfiguration = args.get(name: "configuration")!
var colConfiguration: CollectionConfiguration = args.get(name: "configuration")!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above comment that this will not work as the returned type is ReplicatorConfiguration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove it then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants