You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Kiril Stankov <ki...@open-net.biz> on 2015/07/29 19:55:42 UTC

Limiting id's to ascii.

Hi,
I wonder if there is way to limit document id's only to ascii compatible characters.
Some sort of validation or configuration? 
Thanks.
-- 
Regards,

Kiril Stankov,
OpenNet Software ltd.

Re: Crash on replication

Posted by Alexander Shorin <kx...@gmail.com>.
Hi Kiril,

The answer is in the error:
"Target database out of sync. Try to increase max_dbs_open at the
target's server."

This happens when[1] instance_start_time value for Target db had
changed during replication. CouchDB monitors it in order to detect
server restart, but it's also happens when max_dbs_open is lower when
actual number of active databases on server: in this case CouchDB
closes fd for some dbs in order to be able to work with the other
following by inner lru cache.

The reason why replication get shutdown is that this situation also
falls under the edge case when Target (and Source too) database could
be changed in the middle of replication (cleared by DELETE with
following PUT, or restored from backup with server instance restart).
In this case CouchDB won't continue replication, but starts it over
again to make sure that all the documents will be replicated
correctly..

[1]: https://github.com/apache/couchdb-couch-replicator/blob/master/src/couch_replicator.erl#L784-L786

--
,,,^..^,,,


On Fri, Aug 7, 2015 at 12:09 PM, Kiril Stankov <ki...@open-net.biz> wrote:
> Hi all,
>
> I see few errors like the one below.
> Any idea what the reason can be?
> Why a replication issue should lead to shutdown?
>
> Thanks in advance.
>
>
> [Fri, 07 Aug 2015 08:05:52 GMT] [error] [<0.91.0>] {error_report,<0.31.0>,
>                        {<0.91.0>,supervisor_report,
> [{supervisor,{local,couch_replicator_job_sup}},
>                          {errorContext,child_terminated},
>                          {reason,
>                              {checkpoint_commit_failure,
>                                  <<"Target database out of sync. Try to
> increase max_dbs_open at the target's server.">>}},
>                          {offender,
>                              [{pid,<0.199.0>},
>                               {name,
> "848c572641fd68bf9084a2f465f4d8ba+continuous+create_target"},
> {mfargs,{gen_server,start_link,undefined}},
>                               {restart_type,temporary},
>                               {shutdown,250},
>                               {child_type,worker}]}]}}

Crash on replication

Posted by Kiril Stankov <ki...@open-net.biz>.
Hi all,

I see few errors like the one below.
Any idea what the reason can be?
Why a replication issue should lead to shutdown?

Thanks in advance.


[Fri, 07 Aug 2015 08:05:52 GMT] [error] [<0.91.0>] {error_report,<0.31.0>,
                        {<0.91.0>,supervisor_report,
[{supervisor,{local,couch_replicator_job_sup}},
                          {errorContext,child_terminated},
                          {reason,
                              {checkpoint_commit_failure,
                                  <<"Target database out of sync. Try to 
increase max_dbs_open at the target's server.">>}},
                          {offender,
                              [{pid,<0.199.0>},
                               {name,
"848c572641fd68bf9084a2f465f4d8ba+continuous+create_target"},
{mfargs,{gen_server,start_link,undefined}},
                               {restart_type,temporary},
                               {shutdown,250},
                               {child_type,worker}]}]}}

Error and crash after changing reduce function

Posted by Kiril Stankov <ki...@open-net.biz>.
Hi all,

I had several crashes today.
Here is what I got in the log after changing a reduce function:

[Thu, 06 Aug 2015 08:06:56 GMT] [error] [<0.4332.11>] Uncaught error in 
HTTP request: {exit,
                                                        {shutdown,
{gen_server,call,
[<0.4340.11>,
{pread_iolist,
19405854},
infinity]}}}
[Thu, 06 Aug 2015 08:06:56 GMT] [error] [<0.4296.11>] httpd 500 error 
response:
  {"error":"shutdown","reason":"{gen_server,call,[<0.4340.11>,{pread_iolist,19405854},infinity]}"}

Any idea?

The change I made was from
if(rereduce==true) {...}
to
if(rereduce) {...}

Thanks.

Re: Limiting id's to ascii.

Posted by Alexander Shorin <kx...@gmail.com>.
Use validate_doc_update function that verifies document`s _id field.
--
,,,^..^,,,


On Wed, Jul 29, 2015 at 8:55 PM, Kiril Stankov <ki...@open-net.biz> wrote:
> Hi,
> I wonder if there is way to limit document id's only to ascii compatible characters.
> Some sort of validation or configuration?
> Thanks.
> --
> Regards,
>
> Kiril Stankov,
> OpenNet Software ltd.