Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-3953

[3.1.9 backport] Avoid timeout on creating indexes asynchronously

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.1.9
    • None
    • None
    • Security Level: Public
    • None
    • CBG Sprint 152
    • 2

    Description

      When creating a Sync Gateway database with a large number of collections, waiting for the indexes could time out becoming available. The timeout is 15 minutes per collection, which seemed pretty generous at the time. In https://couchbasecloud.atlassian.net/browse/AV-77598, this was after 486 collections. The behavior was as follows:

      1. Create /db/ will offline:true
      2. wait for some period of time, long enough for the index creation to time out
      3. PUT /db/_config offline: false, this call now becomes synchronous and acquires ServerContext.lock. This will take ~15 minutes if the indexes are still unable, so other calls are blocking.

      We can avoid this problem by having an indefinite retry for waiting for collections when starting asynchronously https://github.com/couchbase/sync_gateway/blob/d106b462d66d2fea6891691a2b73a744530546fc/base/collection_n1ql_common.go#L549. We also want to make this goroutine exit if the context is cancelled https://github.com/couchbase/sync_gateway/blob/d106b462d66d2fea6891691a2b73a744530546fc/rest/database_init_manager.go#L237

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            gregory.newmansmith Gregory Newman-Smith
            tor.colvin Tor Colvin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty