couchbaselabs / sync-gateway-tests

Sync Gateway Functional Tests
3 stars 2 forks source link

Add bucket shadowing tests to functional test suite #78

Closed adamcfraser closed 8 years ago

adamcfraser commented 8 years ago

We don't currently have any bucket shadowing tests in the functional test suite, and it's difficult to cover the breadth of bucket shadowing scenarios using only unit tests.

An example is the issue described in https://issues.couchbase.com/browse/CBSE-2399. In that scenario SG is panicking looking for a non-existent parent ID. The symptom (panic) is being addressed by https://github.com/couchbase/sync_gateway/issues/1603, but functional tests would help get to the root cause.

adamcfraser commented 8 years ago

For the linked issue in particular, it's possibly related to historical data present in the mutation feed. Bucket shadowing always restarts the feed from zero on Sync Gateway startup, so it's more likely to hit issues with historical feed data.

Hypothesis is that there is historical data present on the feed that results in the missing parent. One possible test case might be:

  1. Start Sync Gateway using bucket shadowing.
  2. Delete a document in the source bucket.
  3. Restart Sync Gateway

The issue may be a race condition depending on when #3 happens relative to #2 (i.e. whether the document has been pulled/pushed).

tleyden commented 8 years ago

Is there any temporal requirement between 2) and 3)? I mean, does 3) have to happen immediately after 2) or can there be a long delay and it should still reproduce the problem?

adamcfraser commented 8 years ago

@tleyden I don't think we know yet. I'm trying to dig into the exact sequence of events. At some point I think Couchbase Server may remove the historical entry from the TAP feed and this problem may go away, but it's not clear yet whether there's a race around #2 and #3.

tleyden commented 8 years ago

Closing in favor of https://github.com/couchbaselabs/sync-gateway-testcluster/issues/291