From user-return-31974-archive-asf-public=cust-asf.ponee.io@couchdb.apache.org Thu Jul 11 16:02:24 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id B53FB1804BB for ; Thu, 11 Jul 2019 18:02:23 +0200 (CEST) Received: (qmail 12269 invoked by uid 500); 11 Jul 2019 16:02:21 -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 12258 invoked by uid 99); 11 Jul 2019 16:02:21 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jul 2019 16:02:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 217E71A33DF for ; Thu, 11 Jul 2019 16:02:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.974 X-Spam-Level: X-Spam-Status: No, score=0.974 tagged_above=-999 required=6.31 tests=[SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.972, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-ec2-va.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id fSGBbZcV64cf for ; Thu, 11 Jul 2019 16:02:19 +0000 (UTC) Received-SPF: Softfail (mailfrom) identity=mailfrom; client-ip=204.11.51.157; helo=smtp.justsomehost.net; envelope-from=wohali@apache.org; receiver= Received: from smtp.justsomehost.net (smtp.justsomehost.net [204.11.51.157]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id 9E246BC7AE for ; Thu, 11 Jul 2019 16:02:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.justsomehost.net (Postfix) with ESMTP id D3A48580224 for ; Thu, 11 Jul 2019 12:02:17 -0400 (EDT) Received: from smtp.justsomehost.net ([127.0.0.1]) by localhost (smtp.justsomehost.net [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 41sxHOs-ORh0 for ; Thu, 11 Jul 2019 12:02:16 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by smtp.justsomehost.net (Postfix) with ESMTP id D048B580225 for ; Thu, 11 Jul 2019 12:02:16 -0400 (EDT) X-Virus-Scanned: amavisd-new at smtp.justsomehost.net Received: from smtp.justsomehost.net ([127.0.0.1]) by localhost (smtp.justsomehost.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id i-Y7UuvOIGn3 for ; Thu, 11 Jul 2019 12:02:16 -0400 (EDT) Received: from [192.168.1.14] (toroon0560w-lp140-05-70-29-85-163.dsl.bell.ca [70.29.85.163]) by smtp.justsomehost.net (Postfix) with ESMTPSA id B6705580224 for ; Thu, 11 Jul 2019 12:02:16 -0400 (EDT) Subject: Re: Error deleting and recreating a database To: user@couchdb.apache.org References: From: Joan Touzet Organization: Apache Software Foundation Message-ID: <1fea33bd-ec37-7b8d-41e5-a279f381c74c@apache.org> Date: Thu, 11 Jul 2019 12:02:19 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Alessandro, On 2019-07-11 11:15, alessandro collina wrote: > Hi, >=20 > I would like to know how it is possible to delete all documents in a > database with a single request. If you are on CouchDB 2.3.0+, you can use clustered purge to remove up to 100 documents/1000 revisions at a time. Those numbers are configurable, see the docs: http://docs.couchdb.org/en/latest/cluster/purging.html https://docs.couchdb.org/en/latest/api/database/misc.html > I tried to delete the whole database (using curl to send http method > DELETE) and then recreate it. >=20 > Sometimes unfortunately this approach returns a wrong behaviour: it > seems that erasing is not effective and the subsequent (re)creation > request gives me a "file already exists" error. But not always does thi= s > behaviour appear: the database is often correctly erased and (re)create= d. >=20 > I tried to put some long delay between deleting and creating but it doe= s > not works: the problem still remains. Unfortunately, deleting a database, then trying to recreate it, is a known anti-pattern for CouchDB 2.x. There's no easy fix for it in CouchDB= =2E