Hi everyone, we are very new to couchbase and sync gateway. We are using this technology in a project because we think its exacly what we need. But we are having some trouble and we don’t know if this is the normal behaviour or if we are doing something wrong.
First of all, our testing environment:
- Couchbase 4.0 Community
- Sync Gateway 1.2.1
- Couchbase-Lite Android 1.2.1
- NodeJS Follow (https://github.com/iriscouch/follow)
We don’t have many resources at the moment, so we are doing development on a vagrant virtual machine with both, couchbase and sync gateway on it. 4GB Ram and 4cores for both of them, not each. Maybe this could be an issue for big datasets, but we are working with less than 3000 items on the bucket right now.
Some users creates delta objects (with custom type T) that we will use just once, but we will keep them into the bucket because we give access to certain channels to the user and certain role using this delta object. The sync function will also do a channel call on this objects to sync them in another channel (lets say A), that is not present into the delta object channels attribute on creation. All this calls are using port 4984.
We use a nodejs process, using the “follow” project on github. This listener will keep an eye on changes on the “A” channel. So every time a delta object with type T is created should be retrieved by the listener, the listener will be using the port 4985 on localhost without authentication. That is not happening, sometimes some of this deltas are not pulled by the _changes feed, leading to errors. We are using this deltas as events.
If a new delta object is created (D2) after the missing one (D1), then both are pulled by the replicator.
We have also tested this giving access to every user to the “A” channel, to test if the SDK pull replicator is getting this changes from the feed (to all the other users), but they are not. We did this to test if the problem was the “follow” listener, but it seems to be working fine.
We think that maybe this is something related to the channels view cache, maybe that object (D1) is not triggering the view cache refresh, and the channel A view is not updated correctly. But then, when the D2 object creation triggers this “refresh” and then both are pulled.
I have to say that D1 sequence number is greater than the last pulled change from the follow process, this process will pull the changes since “now” at first run time, but will keep the last sequence number taken by the _changes feed, this number is logged on console and stored into a file (to be used if the server or the node process fails and restarts), and it is lower than the object D1 sequence number.
We don’t know where is the problem, and we don’t know if this could be a sync gateway or a couchbase problem, so please, forgive me if this is not the right tag.