From dev-return-38562-archive-asf-public=cust-asf.ponee.io@subversion.apache.org Tue Nov 20 08:29:14 2018 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 [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4E16E180718 for ; Tue, 20 Nov 2018 08:29:13 +0100 (CET) Received: (qmail 6205 invoked by uid 500); 20 Nov 2018 07:29:11 -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 6182 invoked by uid 99); 20 Nov 2018 07:29:11 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2018 07:29:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 53AADD0156 for ; Tue, 20 Nov 2018 07:29:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.271 X-Spam-Level: X-Spam-Status: No, score=0.271 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_SOFTFAIL=0.972] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=messagingengine.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id rv4687HqPMv4 for ; Tue, 20 Nov 2018 07:29:09 +0000 (UTC) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 1BD515F21E for ; Tue, 20 Nov 2018 07:29:09 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id BC72322C4D; Tue, 20 Nov 2018 02:29:08 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 20 Nov 2018 02:29:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=zIFWtA2ERN6ovj0bT+ytjtDWP5rmEFy3GmRbhpZ7g qM=; b=LM5aiu26AH/CcQjlYnuODwU9PR0bdHfCduj868T1vX1g31Zhgd6vCbh3u /rUSpWvLrTK5tNgtx3mBhisv0iQtn2XekHTSYXS8DfMd0s7VtHsp7UeDXCxoY4IA 5eNpa+KQ0gKbwEcMG/xYctrUB8FuUsGGhZr2XuNF7WHdAdH/IAz9obXwrSrAgn0+ L14wTqqL0ewko0JCG47DZeTpp8fztKKNYk3QXtO5IiU2ZWB/3QSRFGb1+yJJE4ww dTGcWf8u52cP/zeOkLF2WNy7Jc4NawQyLlZqOaH+aOG1s12rmnNrXbjSJoevs4YB mpMNBN0aZjRiqK15E0BEdCEk1JBgQ== X-ME-Sender: X-ME-Proxy: Received: from tarpaulin.shahaf.local2 (bzq-79-180-115-155.red.bezeqint.net [79.180.115.155]) by mail.messagingengine.com (Postfix) with ESMTPA id 9DA6110340; Tue, 20 Nov 2018 02:29:07 -0500 (EST) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1005) id 42zclP1HLpzg7; Tue, 20 Nov 2018 07:29:05 +0000 (UTC) Date: Tue, 20 Nov 2018 07:29:05 +0000 From: Daniel Shahaf To: Dmitry Pavlenko Cc: dev@subversion.apache.org Subject: Re: [PATCH] A test for "Can't get entries" error Message-ID: <20181120072905.u6pc5pzphp2cz4so@tarpaulin.shahaf.local2> References: <55095032.ozZm5OQrnM@dmit10> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <55095032.ozZm5OQrnM@dmit10> User-Agent: NeoMutt/20170113 (1.7.2) Dmitry Pavlenko wrote on Mon, Nov 19, 2018 at 17:05:16 +0300: > Hello Subversion community! > I've run into an error: when performing 2 specially constructed updates one after another > within the same session, SVN fails with > > $ ./ra-test 15 > svn_tests: E160016: Can't get entries of non-directory > XFAIL: ra-test 15: check that there's no "Can't get entries" error > That error code is SVN_ERR_FS_NOT_DIRECTORY. > error. I believe these updates constructed that way are valid, so the problem is > somewhere in FSFS code. It's also interesting that if these updates are run > separately (e.g. by adding "if (FALSE)" to one or another), they succeed. > Could you please clarify whether the bug reproduces under other backends (FSX and BDB)? > +++ subversion/tests/libsvn_ra/ra-test.c (working copy) > @@ -1784,7 +1784,113 @@ commit_locked_file(const svn_test_opts_t *opts, ap > +cant_get_entries_of_non_directory(const svn_test_opts_t *opts, apr_pool_t *pool) > +{ > + svn_ra_session_t *session; > + const svn_delta_editor_t *editor; > + void *edit_baton; > + const svn_ra_reporter3_t *reporter; > + void *report_baton; > > + SVN_ERR(make_and_open_repos(&session, > + "cant_get_entries_of_non_directory", opts, > + pool)); > + > + { > + SVN_ERR(svn_ra_get_commit_editor3(session, &editor, &edit_baton, > + apr_hash_make(pool), NULL, > + NULL, NULL, FALSE, pool)); > + > + SVN_ERR(editor->open_root(edit_baton, 0, pool, &root_baton)); > + } You make all commits using the same EDITOR. Is that allowed? Should you make the 'editor' variable block-scoped and call svn_ra_get_commit_editor3() anew in each block? > + { > + SVN_ERR(editor->open_root(edit_baton, 1, pool, &root_baton)); ⋮ > + } > + { > + SVN_ERR(svn_ra_do_update3(session, &reporter, &report_baton, > + 3, "", svn_depth_infinity, TRUE, FALSE, > + svn_delta_default_editor(pool), NULL, > + pool, pool)); > + SVN_ERR(reporter->set_path(report_baton, "", 3, svn_depth_infinity, FALSE, > + NULL, pool)); > + SVN_ERR(reporter->set_path(report_baton, "B", 2, svn_depth_infinity, FALSE, > + NULL, pool)); > + SVN_ERR(reporter->finish_report(report_baton, pool)); > + > + > + } > + { > + SVN_ERR(svn_ra_do_update3(session, &reporter, &report_baton, > + 4, "", svn_depth_infinity, TRUE, FALSE, > + svn_delta_default_editor(pool), NULL, > + pool, pool)); > + SVN_ERR(reporter->set_path(report_baton, "", 4, svn_depth_infinity, FALSE, > + NULL, pool)); > + SVN_ERR(reporter->set_path(report_baton, "B", 3, svn_depth_infinity, FALSE, > + NULL, pool)); > + SVN_ERR(reporter->finish_report(report_baton, pool)); > + } I agree that this should work, and therefore that it's a bug. Suggestions for further debugging: - Further minimise the test. Try to have fewer add_file calls, fewer set_path calls, etc.. (I realise you must have minimised it a lot already, from whatever the original instance was, but the more the better.) - Try doing the two updates in the opposite order (exchange the order of the two blocks). - See if the bug happens under FSX/BDB. That would tell us where to look further (in libsvn_fs_fs, or in the reporter logic in libsvn_repos). > + return SVN_NO_ERROR; > +} Style nits: - Per-block comments would be helpful. They don't need to be detailed, but something like /* r1: Create 'A' and 'A/mu' */ would help skim the function quickly. - The test name isn't very descriptive. I think it would be better to name the test after what it expects to work: doing two updates in a single session after a file replacement by directory. - One line exceeds 80 columns. Cheers, Daniel