From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.42 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796408739; b=ygIflbS6QAnEowmt3CYwko9mdH2XrVXqMqTvg76HuFbHqRTejYS5/GRvLZWJD8utFvtV 1J9aGKRPMomn6KgiUPv1I4tzbXv47xbVkSg//mLndFk/bAKZVfOcKkltQR05yGsZaqw53 uoLquVDG/nPeqc8PtEUn2jSnsQ2R8k7nqBgAmX/oYTYDaVitQ1mMoFVWl9ItezHf5Gewo f4HEzBuzRDFXyi9oU/rnnoMfGYCQskzLK6dRxmqLuk1FVYS4p4O40w2fJ9au1lpsLExzW feommvAf8v7EcpJTfwrCh1zuX8wzOYCVVPP3SXzDKGSU0pOZWKXC3Y1l6lGL75D6SLA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796408739; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-Id:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=4uXh6oMcTmf3zf93BNolhOGHs3kfck4uL5zQhQmBH7s=; b=qngShpnHg3YE1cqV7gfpHsb2+k9eYSk63PMoiTlLrrUeeD27kTrBwhyOIjMIAGnGOdUM JbyH8YAs7xl5hY4mq9BMLLcxRqqTeWQfW34j0743muz4rKJST4D7cxES0DXMyYrPQEXUv mCZKy0Y/G3b31BeL/o13pJzYe8uR4yxHerT1J1JWHLvzb0xhp/k/GdbuxtNHWd5+aRbJI xIq96jDVk0jcaieEhaGGblxdapuT+CTDEX5oGblpV8yTBQXFZ98eHGFmve95MagrHO5WK AuyQCg1zRsSHoH1Q9piXmxYqNUVfRlGXbshhJbfJ4BKmskBOdSrZ4Xnwt4lh8/I9iCA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=t7dIblzD; arc=none smtp.remote-ip=74.125.82.42 Received: from mail-dl1-f42.google.com (mail-dl1-f42.google.com [74.125.82.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B59CD606A6BB for ; Fri, 4 Dec 2026 18:25:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B59CD606A6BB Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=t7dIblzD Received: by mail-dl1-f42.google.com with SMTP id a92af1059eb24-1b5d5f12565so1073534c88.1 for ; Fri, 04 Dec 2026 10:25:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796408738; x=1797013538; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=4uXh6oMcTmf3zf93BNolhOGHs3kfck4uL5zQhQmBH7s=; b=t7dIblzDRAFMvN71KUyzpVlJn8uJWOJdsBVAqvh9q7A23RbU0OEnKthrZvU+3N6cg+ yqglgh3sUzGgMK+xMkgASBbOPBbl1Xkm+ifOUX+AkhD+bfAtYoOYLsQTDj67h0s4LniH Qcdz0rBLPpGjubR2GunhxSDydV2VWz95Warc/e69VrFGC0QID0iGJagrKKL6OVTtyfhM UY18gVyWHn+Agk/iso7CT+TFmABhjDK5r8Vr6VoS+NpRgM24k5vznrsc1V+JXN6DJn07 HHFJZyjkqxc/PHnNhgYmXMMJfm+BQOr9TrTXHw9qjZEeo1oMqV1RNTD5euisAF6DF1c3 uNKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796408738; x=1797013538; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=4uXh6oMcTmf3zf93BNolhOGHs3kfck4uL5zQhQmBH7s=; b=vSdc4qAp6Okmh/ji/+/I9CMGcpfqtfTlnFzpF9YRP5tPeHijM45zUXD4t6WaReC3nx upwks6WxJnQp50RnRYqi1LOkUoooqxbQ5n+XFd4NJOTpw0JeUlIn3nlBg8GJW9f4xafG SjyI9a1rgPeRfYqEyS/PA8d6Fn1/iVqofj2CKXvJfBwUEsqmm/6WovVxFDyTsNvvYc8c ykzAYqR5QRUxN03acAVqC9bFOxcMrt1HUSgsmzr4yP5X27J3yuxb9oCLMVpra03yolIy v9IwwDpqUokj1ktjzvlK/2CBcYgXx8VhbRo0Iagcl4QgKmuctiJmbBXklLk6936Nqnp5 g8VA== X-Gm-Message-State: APuU4Z/Ddx07D054perRN3vbFc20i0tE3iVu8oPn2t8fUOkOdJIUMIWa y8pknFeKDlrByWvOmLUVnBP4jNrVZTYt2vW6ANNB+6Kpc23x1uba1SXD X-Gm-Gg: AZFdTZcuFRytdiRFYBriafDjDlco2yUqGfIHAco4MV/CvIfHJOO9Upe2vRGXLpCkap2 4JLgzUEro3Rzteglz4vkmzwkn56tsoM/VCHNcIfuvQ+wdmBx5tRQsvcayOF3R2POEUFXaXIV+Jh JgJa3/83QqlmyVBwsMVuYbS/hVzKb5N+YNkj/H+ATazA31ZQ4khCqzsflzGiqvsezNp0QKgNDpr LPqhrUp7jmy6tSqK7y84Gn2pkrZoqcUE2gjwWIsMhSd7R2CPqQ1a6LDYDcgpdQdqrwuoX8kY0C+ HTN36FVHD9F77HD+JbvfNqVKLqDWpcD8hbEdLfxKltAMaAKc1TaT3B+gMRHfqVKLT5Ja2ej/b1p ESaNN9jGJRm3FSQh7VfmoJUz4FZnEag0wfrqcx5FMydyj6aLR/v8SKQOhNCBKaT1FnGwBXcj02P wWj9cXr9+7YAc77PFiBZ/W4Jk6BGbMsXa2aCBMNSJTD+1R4qOjttTqQa9CQD63CEVCAWeHmsUbW n74+9AJmm0xGtQb9JAz0p6lppZjTSQJwH2GD2vYaJE0XVyFnh8K59Mk5ya7zks+4qBCMdRjGtOF 2k7csPWfpRgsiEX10m5jI4Aq11l1by1PgUk4oUkMvxeyBNll3ZtOWFM6ujFFco7uoxQGx3smxHP Z8ul+QEoCHiWgq0C5KqVwE1Vo549dLPdCTqHrFj9s/J4g X-Received: by 2002:a05:701a:cc95:20b0:1b5:bcda:2c7e with SMTP id a92af1059eb24-1b5d7114b2dmr2427280c88.16.1796408737761; Fri, 04 Dec 2026 10:25:37 -0800 (PST) Received: from localhost.localdomain ([2601:645:c100:ab8f:a453:914a:6bd1:2a12]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5d646217esm7971506c88.11.2026.12.04.10.25.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Dec 2026 10:25:37 -0800 (PST) From: Aman Ganapathy To: Patrick Steinhardt Cc: git@vger.kernel.org, John Cai Subject: Re: [PATCH] reftable/writer: fsync table after writing its footer Date: Fri, 4 Dec 2026 10:25:35 -0800 Message-Id: <20261204182535.76118-1-amanganapathy@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: References: X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Fri, Dec 04, 2026 at 07:53:15AM +0100, Patrick Steinhardt wrote: > This failure mode is quite surprising. I would have expected that we die > with a lot of noise and refuse to do anything in case the reftable stack > is corrupt. Did you by any chance also investigate why that's the case? I hadn't yet, so I traced a path through the code now. As I see it, the stack fails to load in reftable_be_init(), which saves the error in refs->err and doesn't print anything. Every ref read after that fails, but the error gets lost on the way up. If you look up a single ref, refs_resolve_ref_unsafe() just returns NULL, which is the same as when the ref doesn't exist. So "git rev-parse HEAD" says "unknown revision", like in an empty repo. If you list refs, the error does come back, but for-each-ref and gc don't check it. So for-each-ref prints nothing, and gc thinks nothing is reachable and prunes everything. You can see it by cutting the footer off the newest table: git init -q --ref-format=reftable repo && cd repo git commit -q --allow-empty -m one t=.git/reftable/$(tail -1 .git/reftable/tables.list) truncate -s -68 "$t" git rev-parse HEAD # "unknown revision" git for-each-ref # prints nothing, exits 0 With the files backend, a truncated packed-refs dies right away with "unterminated line in .git/packed-refs", so I'd expect the same here. Should reftable_be_init() just die when the stack is corrupt, or is there a reason the error is kept for later? Happy to send a patch for it if need be! Thanks for the review! Aman