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 CBD4717371 for ; Tue, 3 Mar 2015 11:59:22 +0000 (UTC) Received: (qmail 64269 invoked by uid 500); 3 Mar 2015 11:59:17 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 64215 invoked by uid 500); 3 Mar 2015 11:59:17 -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 64204 invoked by uid 99); 3 Mar 2015 11:59:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2015 11:59:17 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of philip.martin@wandisco.com designates 74.125.82.172 as permitted sender) Received: from [74.125.82.172] (HELO mail-we0-f172.google.com) (74.125.82.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Mar 2015 11:59:12 +0000 Received: by wesq59 with SMTP id q59so39384560wes.1 for ; Tue, 03 Mar 2015 03:58:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wandisco.com; s=gapps; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=LWsluyC9xuUx4fJNY0hsKnfnuFthuSpgaMHzuSxghlE=; b=cWuWUMzgApp75QlvHejdBAiKveTMnfDVTq9xeZPuKnRuoeIsCjxv85h+NGPXxmMCZO iuB01cKUxBK5iKxBCdScXCj6S/wE/6QFSZLSPgY4Qrwsaygp/RqHArMohU4tj+IK7vmg dizqAqoa5hsX46Fs6oX9wDKqsFrlPbSVOHQac= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=LWsluyC9xuUx4fJNY0hsKnfnuFthuSpgaMHzuSxghlE=; b=a9JYHzqpWgzZG72+iUoMSZUvw9b65zMr26gPerrqn5G4Re6iQWc5aUPXdezxM4Q21d UD5VvPLDyu0KfUv8zqEc/XbAEMB4UiPwRTdfVzcMc7+Cln2nChPfJoP/cezK1DRknKi6 EPY1Fyk5pjZR8urTv1yofN1PM3QW+RM9gBN9xwVq2qU1RoUs/lxUEJe+m6SFCJoQFMa3 Vqqw+Lx554XWspHmQT0sNcUtE6DxxwbWH42B4oMvhXd4u3kj2tWjH8mVRG1E3a4adcoz 7wJinObxVc/4wT/cy3indi01KrRIIlxEiwFXlsQfpbZ7vqWXbg2B6WFcqfc5CgWld6tq H0Cw== X-Gm-Message-State: ALoCoQla/G4sNImcK4DP8Nq/Y32ZlckClm4Y8OU1MfFlJ5qzLkAsyRGdsDS0BfCAdka9OClt4iGc X-Received: by 10.194.173.138 with SMTP id bk10mr66463517wjc.112.1425383930856; Tue, 03 Mar 2015 03:58:50 -0800 (PST) Received: from localhost (cpc20-farn7-2-0-cust13.6-2.cable.virginm.net. [86.15.228.14]) by mx.google.com with ESMTPSA id hs7sm20276855wib.4.2015.03.03.03.58.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2015 03:58:48 -0800 (PST) From: Philip Martin To: Evgeny Kotkov Cc: Subversion Development Subject: Re: [RFC/PATCH] Modifying internal FS transaction properties References: Date: Tue, 03 Mar 2015 11:58:48 +0000 In-Reply-To: (Evgeny Kotkov's message of "Mon, 2 Mar 2015 23:23:32 +0300") Message-ID: <8761aijnrb.fsf@wandisco.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Virus-Checked: Checked by ClamAV on apache.org Evgeny Kotkov writes: > I propose that we solve this part of the problem with the attached patch. > Please note that while preparing this patch, I also unveiled that the > SVN_FS_TXN_CLIENT_DATE flag might not work as expected with BDB. > I think we should fix this with a separate patch; see the comment in the > new test_internal_txn_props() test. > > Log message: > [[[ > Error out on attempts to change internal transaction properties like > 'svn:check-locks' through the public FS API. Looks OK. Both BDB and FSFS set the date on the txn when the txn is created. This was introduced so that admins could look at the date and get the txn creation date which is useful when deciding whether or not to delete old txns. The BDB bug is that this setting should not be classed as an explicit setting by the client. > 2) These internal properties currently are a part of what svn_fs_txn_proplist() > and svn_fs_txn_prop() return. From my point of view, they are nothing more > than an implementation detail and I don't think that something like that > should ever reach the caller of a public API. However, this is how things > have been working for a long time, and I am not sure about changing it now, > although it does make sense to me. Using svn:date to store txn creation date doesnt't work so well now that we allow clients to set svn:date. It might have been better if the txn creation date was stored in a separate txn property that was deleted on commit. If we were to do that then we would need to expose the internal txn value, which would mean svn_fs_txn_prop/proplist could not hide all internal txn props. > + if (strcmp(opts->fs_type, SVN_FS_TYPE_BDB) == 0) > + { > + /* ### Skip the svn:client-date check with BDB. I think that we have a > + bug in the BDB backend, because when SVN_FS_TXN_CLIENT_DATE is > + set, a transaction created with svn_fs_begin_txn2() has the > + svn:client-date property value = "1", even though no explicit > + svn:date changes happened (it's "0" in FSFS). > + > + This happens because svn_fs_base__begin_txn() sets svn:date in a > + separate svn_fs_base__change_txn_prop() call when the initial > + internal properties, including SVN_FS__PROP_TXN_CLIENT_DATE, are > + already set. As a consequence, we should have different bevavior > + for transactions created with SVN_FS_TXN_CLIENT_DATE, and with no > + explicit svn:date changes happening depending on the FS backend. > + When such transaction is committed, FSFS is going to use the time > + of the commit for the 'svn:date' value. BDB, however, is going > + to erroneously use the timestamp of the svn_fs_base__begin_txn() > + call. > + */ > + } > + else > + SVN_TEST_STRING_ASSERT(val->data, "0"); I think this test should FAIL, or XFAIL, on BDB rather than be hacked to PASS. -- Philip Martin | Subversion Committer WANdisco // *Non-Stop Data*