[MB-6995] set_db_and_ix_paths and ns_server:restart are raceful which may cause couch_db to fail to start Created: 24/Oct/12  Updated: 31/Jan/14  Resolved: 25/Oct/12

Status: Closed
Project: Couchbase Server
Component/s: ns_server
Affects Version/s: 2.0
Fix Version/s: 2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Deepkaran Salooja Assignee: Aliaksey Artamonau
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: build 1888

Attachments: GZip Archive collect_info.gz    


Installing couchbase on a node after uninstalling previous installation with non-default data path gives error "Got no response from save request"
Screenshot attached.

Steps to reproduce:

On a CentOS VM:
1. rm -Rf /opt/couchbase/*
2. rm -Rf /data/*
3. sudo rpm -i couchbase-server-community_x86_64_2.0.0-beta.rpm
4. Setup the cluster with data/index path set to /data and create default bucket
5. Create a couple of documents
6. sudo rpm -e couchbase-server-2.0.0-1723
7. sudo rpm -i couchbase-server-community_x86_64_2.0.0-1888-rel.rpm
8. Setting up the cluster again with data/index path set to /data gives error and couchdb fails to initialize with below crash report

=========================CRASH REPORT=========================
    initial call: couch_db:init/1
    pid: <0.5333.0>
    registered_name: []
    exception exit: {function_clause,
      in function gen_server:terminate/6
    ancestors: [couch_server,couch_primary_services,couch_server_sup,
    messages: []
    links: []
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 610
    stack_size: 24
    reductions: 376

Diagnostics attached.

Comment by Steve Yen [ 24/Oct/12 ]
first guess assignment on this one
Comment by Farshid Ghods (Inactive) [ 24/Oct/12 ]

we dont support offline or online upgrade of 2.0 beta to 2.0 server.
Comment by Steve Yen [ 24/Oct/12 ]
It seems the user's missing step 6.5 -- rm -rf /opt/couchbase/*
Comment by Aliaksey Artamonau [ 24/Oct/12 ]
As far as I can tell from the logs it has nothing to do with upgrade. It's a genuine race condition that can happen whenever database and index paths are set up.
Comment by Thuan Nguyen [ 25/Oct/12 ]
Integrated in github-couchdb-preview #526 (See [http://qa.hq.northscale.net/job/github-couchdb-preview/526/])
    MB-6995 Don't restart couch_{server,set_view} on dir changes. (Revision 18bce935e8cf0d31316495b5462ed9429801a84e)
MB-6995 Stop related apps when couchdb application is stopped. (Revision a5a033c9edc81ed7a1acfd3c0d05745215973dca)

     Result = SUCCESS
Farshid Ghods :
Files :
* src/couch_set_view/src/couch_set_view.erl
* src/couchdb/couch_server.erl
* src/couchdb/couch_view.erl

Farshid Ghods :
Files :
* src/couchdb/couch_app.erl
Comment by Deepkaran Salooja [ 26/Oct/12 ]
Verified with build 1901
Comment by kzeller [ 06/Dec/12 ]
Added to RN as:

In the past if you set the disk path for data to be the same path as that for index files,
Couchbase Server would fail to start. This is fixed.
Generated at Tue Sep 16 14:11:14 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.