Return-Path: X-Original-To: apmail-subversion-dev-archive@minotaur.apache.org Delivered-To: apmail-subversion-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9CF4B17E24 for ; Fri, 19 Jun 2015 12:27:46 +0000 (UTC) Received: (qmail 41985 invoked by uid 500); 19 Jun 2015 12:27:46 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 41935 invoked by uid 500); 19 Jun 2015 12:27:46 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 41925 invoked by uid 99); 19 Jun 2015 12:27:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jun 2015 12:27:46 +0000 X-ASF-Spam-Status: No, hits=3.3 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URIBL_SBL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of evgeny.kotkov@visualsvn.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; Fri, 19 Jun 2015 12:25:32 +0000 Received: by labko7 with SMTP id ko7so73267573lab.2 for ; Fri, 19 Jun 2015 05:26:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=visualsvn.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=P3s+eiMsSpW1dh6vPFJEoVMqe9W98ewpV7Lj+q137mI=; b=fQLEKs08T9IiBjHNwY5Hcg76ewBUUx6gjU6eC6f9UkBLS8L3eZyv1teF74p+FMv4/m noi8j8g3HmLRV4oE4A4xvDnEK+XAPEUe8UqNzNt+wlqIZsp9rGwOTeK1Yul53I8eih9i w2SummgWhiT/bv+avuS9kFwvo7kYWdJQ3dbiM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=P3s+eiMsSpW1dh6vPFJEoVMqe9W98ewpV7Lj+q137mI=; b=g9qr9QDoxpgksIcZTamBAYFPKE7fv3eld2cu4I/p/pXjk/aMtqzNFrh83EztqNBYgo MGZ0etDMpD591nHFEPzHA2RNmr2lrLRqW70LFQnBhiL6ryvG+k6QFKFPDaRnjGMBQP3C RoL4pv5y7nD2WlWGfVSFfz/bJscce5efe87YQFnuyiRblDc02jazvHLvlGSFhua6mrii n793VUdaiZr7E5mHrY7kvqkuorW/qAHAHBzUJu7kxEnU8khY/5a8GXP87lI+hzwGUKeS DndymtYrN3OkV1xCwXBkvyCw3ZwigdRC7BYy1rl/7BDR5t+7pYBPg94G4pwMLBRic0eA QHlg== X-Gm-Message-State: ALoCoQlCXH8PCxLNkh812GeiSfFPi7t5twvufgweAbOHhYyaSrf9nNrDfeyYG9AUK0pviqJPOy0s X-Received: by 10.152.7.206 with SMTP id l14mr17539257laa.3.1434716795284; Fri, 19 Jun 2015 05:26:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.124.146 with HTTP; Fri, 19 Jun 2015 05:26:14 -0700 (PDT) In-Reply-To: References: From: Evgeny Kotkov Date: Fri, 19 Jun 2015 15:26:14 +0300 Message-ID: Subject: Re: FSFS7: 'svnadmin hotcopy' requires write access to the source To: Stefan Fuhrmann Cc: Subversion Development Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Stefan Fuhrmann writes: > And the regression should be fixed. [...] > There is a trivial fix: Try to acquire the lock and fall back to the > non-locking behavior if you get an EACCESS. The nicer way is to check > beforehand and make the check slightly more generic. That's what I did in > r1686232. I don't see how r1686232 could possibly work on Windows. The APR_FREADONLY check tells us if a file has FILE_ATTRIBUTE_READONLY. This is orthogonal to the DACL of the file =E2=80=94 i.e., you cannot write or lock a file wit= hout having an appropriate access control entry in the DACL, even if the file does not have a read-only attribute. With this fix, the following scenario (attempt to hotcopy a source repository while only having R access in DACL) is still going to fail: svnadmin create source svnadmin pack source icacls source /inheritance:r /grant MyAccountName:(OI)(CI)(R) svnadmin hotcopy source target svnadmin: E720005: Can't open file 'source\db\pack-lock': Access is denie= d. I cannot say that I feel confident about the other proposed option (handlin= g EACCES after trying to acquire a lock), as opposed to a plain revert. Doin= g so is going to put us into a 12 second retry loop in the common case where a Windows account can only read the hotcopy source =E2=80=94 and that's als= o going to be a quite visible regression. > My point here is that *occasional* failures in a functionality that peopl= e > might use for creating backups is a problem. For example, people running > pack in their post-commit hooks may not notice the failure during testing= , > so they don't implement the redo fallback in their backup procedure. Or, > they notice the failure and get that unsettling feeling ... Is this argument for or against serializing hotcopy and pack? Because if w= e serialize them, na=C3=AFve post-commit hooks that call 'svnadmin pack' sync= hronously could wreak much more havoc. Hotcopy blocks pack, so, if an administrator = is currently performing a backup with 'svnadmin hotcopy', packing will only be= gin after the hotcopy is done. Given that hotcopy could take a significant amo= unt of time, depending on how fast the storage works, users will probably witne= ss hanging 'svn commit' operations, as the execution of the post-commit hook i= s going to be blocked by the hotcopy. The last, but not the least, hotcopy now blocks other hotcopies, so one can no longer perform the backups in a parallel manner, e.g., to two different backup destinations. > Reverting the whole of r1589284 would be excessive. Simply not using the > "with_pack_lock" call would make for a much smaller, less intrusive chang= e. Hmm, what could be less intrusive that just reverting a change? I see it a= s that if we stop locking the hotcopy source, we don't require other relevant bits of this change, i.e., the supplementary logic that made this locking possible. Why should we keep it? Doing so would also allow us to get rid of the inconsistency in how repos a= nd fs layers currently perform the hotcopy that I mentioned in [1]. Currently= , if an API user calls svn_fs_hotcopy3() in the non-incremental mode, the tar= get filesystem is immediately openable, even while the hotcopy operation is sti= ll in progress). This means that anyone calling svn_fs_open2() on this target could be working with a filesystem stub without the lock tree or db/txn-cur= rent file, and I don't think there is anything good in that, quoting [1]: [[[ The whole idea of the non-incremental hotcopy is that it *does not* make th= e destination visible until the hotcopy finishes. This is how the things work= ed prior to this changeset and this is how the svn_repos layer currently works= . By writing the format file before actually doing something we do not only expose our internal stub to the world (which really is a stub without even = r0), but will also leave this internal stub openable in case the hotcopy fails. This stub does not even have to be a normal filesystem and we only need it to bootstrap the hotcopy process, but we now behave as if it was! Finally, the 'repos' and 'fs' layers now behave inconsistently in these ter= ms, i.e. svn_repos_hotcopy3() still writes the format file only when everything= is done. ]]] What do you think? [1] http://svn.haxx.se/dev/archive-2014-07/0124.shtml Regards, Evgeny Kotkov