Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 49F6AD514 for ; Thu, 14 Feb 2013 10:06:04 +0000 (UTC) Received: (qmail 34783 invoked by uid 500); 14 Feb 2013 10:06:02 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 34638 invoked by uid 500); 14 Feb 2013 10:06:02 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 34612 invoked by uid 99); 14 Feb 2013 10:06:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Feb 2013 10:06:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of a.zatvornitskiy@gmail.com designates 209.85.215.47 as permitted sender) Received: from [209.85.215.47] (HELO mail-la0-f47.google.com) (209.85.215.47) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Feb 2013 10:05:55 +0000 Received: by mail-la0-f47.google.com with SMTP id fj20so2113930lab.34 for ; Thu, 14 Feb 2013 02:05:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=KyKvri4zHqY8xnmGIzSeiLTkSzi+Tdlx/bCdzIye3y8=; b=lLJAAV2Aq7H0FUD/nD60pEPHS9Lh0X7VJ6ukUHy/zjN9WCHi7A0usSPk9eznmQ6Xpd mjL0k5bTUsNRJuefQVU0nTL4/zChPaVnw1K5hP2EebPvL4VFc4Jt4fGCi45TjS2wYNpZ kXvc8lIwPJIyzvLOrstDiWHL16Tw3+TbvtgmAX2npL8tya3knCNxUmKim7mxVxjeMl2g S1Sb3tNX9Bd16j7naq+N/KExEhxd/JPT1+20Ix3nyW5hB1VMtCcnS1rJPCuPmonp7PpR 2WoMtjdOger9zL44UXAr261s7oVeAoH83lSywmbaL/RpNOoZKe+DtqKGy+J9xDu+Fub/ keYA== MIME-Version: 1.0 X-Received: by 10.152.148.195 with SMTP id tu3mr20551733lab.27.1360836334708; Thu, 14 Feb 2013 02:05:34 -0800 (PST) Received: by 10.114.83.1 with HTTP; Thu, 14 Feb 2013 02:05:34 -0800 (PST) In-Reply-To: References: Date: Thu, 14 Feb 2013 12:05:34 +0200 Message-ID: Subject: Re: I've just released a first preview of couch_normalizer From: =?UTF-8?B?0JDQu9C10LrRgSBaYXR2b3JuaXRza2l5?= To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=e89a8f23485553e83404d5ac663b X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f23485553e83404d5ac663b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi! I pleased that you find it useful. In short: 1. Take a short look on {num_workers, 5} configuration options. It means that for target db a couch_normalizer will use 5 workers, each worker works under OTP. A particular worker spawn its own child process for applying particular scenarios for current document. You should see log messages in case one of them ends or fails (for many reasons such a conflict, scenario logic, etc). Check this code http://goo.gl/TasYp for more details. 2. I think that some kind of final notification should be. Feel free to submit an issue. Is it what you want? http://goo.gl/UThkT 3. Yeah, Alex I know. That why we used the Elixir and its amazing functional meta-programming features. On Wed, Feb 13, 2013 at 5:47 PM, Alexander Shorin wrote: > That is awesome, Alex! > > This is the thing I always dream when our document schemes receives > new update and there is need to apply they for large amount of > databases. Trick with local database mirror and replications works, > but it's not very fast. > > Few questions: > > 1. What happens it normalization fails due to some reasons? For > example, due to conflict update. Have I start whole normalization > again in this case or it will just write few notes about conflict in > logs and will try apply script to document one more time? > > 2. Is it possible to receive final result of the normalization job and > error description if it fails? Continuous querying _active_tasks looks > not optimal and it's possible to miss the moment when normalization > fails. > > 3. Only Erlang and Elixir migration scripts are possible, right? Or > it's possible to use any scripts that supports CouchDB stdio > communication protocol? I suppose many of us who faced same problem > already have Python/Ruby/whatever-lang scripts that successfully > handles scheme normalization and well tested. It would be helpful to > not force them made whole job again. > > -- > ,,,^..^,,, > > > On Wed, Feb 13, 2013 at 7:04 PM, =D0=90=D0=BB=D0=B5=D0=BA=D1=81 Zatvornit= skiy > wrote: > > Hi everybody! > > > > A couch_normalizer v0.6 is out! > > > > The couch_normalizer designed as a standard Apache CouchDB httpd handle= r > > and uses a Rails db migration approach. Written both in Erlang and > Elixir. > > Works well on production and has a great IO performance. > > > > For example: > > > > % Starts a normalization process. > > > > % curl -v -XPOST -H"Content-Type: application/json" > > http://127.0.0.1:5984/db/_normalize > > > > % =3D> {"ok":"Normalization process has been started (<0.174.0>)."} > > > > > > % Gets a normalization process execution status. > > > > % curl -v http://127.0.0.1:5984/_active_tasks > > > > % =3D> > > > [{"pid":"<0.174.0>","continue":false,"db":"db","docs_conflicted":0,"docs_= deleted":0,"docs_normalized":0,"docs_read":3000,"finished_on":1358513508,"n= um_workers":5,"started_on":1358513508,"type":"normalization","updated_on":1= 358513508}] > > > > As a result, it allows to deploy migration scripts (aka scenarios) and > > change big amount of documents as fast as possible (without HTTP overhe= ad > > and some kind of 'delayed jobs') via internal CouchDB functions, such a= s > > couch_db:open_doc/2, couch_db:update_doc/3 and so on. > > > > Check more: https://github.com/datahogs/couch_normalizer > > > > If you want to contribute, feel free to open an Github issue or submit = a > > pull request or ping me offline) > > > > It still under scoping and development. > --e89a8f23485553e83404d5ac663b--