On Fri, 8 Jul 2022 at 22:04, Robert Newson <rnew...@apache.org> wrote:

> Hi,
>
> The config file isn't monitored, so just changing the file won't help,
> you'd need to restart couchdb.


I did not change the config file, used the config API instead and checked
that the files were changed afyerwards.


Did you have anything bypassed in the first place, though?

Yes:
- os_process
-read
- write
- view_update


Could you explain the replication problems you encountered?


A few of these:

[error] 2022-04-27T00:14:26.027209Z
couc...@couchdb-310-couchdb-2.couchdb-310-couchdb.couchdb.svc.cluster.local
<0.28525.7700> 734f3d6415 req_err(50502807) unknown_error : normal
[<<"chttpd:catch_error/3 L358">>,<<"chttpd:handle_req_after_auth/2
L324">>,<<"chttpd:process_request/1
L305">>,<<"chttpd:handle_request_int/1
L243">>,<<"mochiweb_http:headers/6
L150">>,<<"proc_lib:init_p_do_apply/3 L247">>]

In addition to this, the source cluster was constantly compacting
views and shards, even when there wwere no transactions.


I can say for sure that it is generally unsafe to modify shard files
> out-of-band while couchdb is running, as it appears you did at step 5.
> Couchdb may well have opened the shard files (created at step 3) and it
> holds them open in a cache.
>

The renaming of files to match the database-id happened on a shared volume
that was not used by either cluster, only after setting the target cluster
to maintenance mode I copied the shard files.



> I don't think we have written up how to do this properly (we strongly
> advise replication instead) but I did write an SO post a while ago:
> https://stackoverflow.com/questions/6676972/moving-a-shard-from-one-bigcouch-server-to-another-for-balancing.
> The sharing scheme for bigcouch is the same as for couchdb 3.x.
>
> The essential difference is to _not_ create the clustered database at the
> target cluster until _after_ you've copied the shard files over. You then
> create the '_dbs' doc yourself. (Note that in big couch this database was
> called "dbs").


I based my procedure on the  CouchDB doc (4.4.3. Moving a shard).

Cheers,
Luca Morandini

Reply via email to