Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1srUoS-0026YC-Fu for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Sep 2024 04:00:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1srUoQ-00DxfP-Hr for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Sep 2024 04:00:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1srUoQ-00DxfG-8v for pgsql-hackers@lists.postgresql.org; Fri, 20 Sep 2024 04:00:07 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1srUoN-0007ZO-7s for pgsql-hackers@lists.postgresql.org; Fri, 20 Sep 2024 04:00:07 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-53653682246so1748760e87.1 for ; Thu, 19 Sep 2024 21:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726804803; x=1727409603; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=0uw0OV+P+R3MfgO6fcG8gkEPgZNIDvClM8Ygg6sQ+Qw=; b=CraamxJhD+QoEgr373j8e2+Xs6KrUPRF1CQJclZjhqwGhEuGCxyIrHqgOfz+BxuJNn jBZ2zoRBqHOqMm5vjSY29eu6PIp3ZdhrAvZcOQS2XUR0NyYy+0oaKNrJbuhkOva2HW6H 1Rd6Xj/ng4kU9SfEu4VFl2Qe1SeJN4Qn65FsSwvXJn8bXMvzNgXfIOJ3All6+2CZsiSB 48zDm5sobD1roEqxS4vLD/DZvis95VT3RRsIZEz10Q6Jg+4nVFhr8436LGxmcqbF0pyR 7s8o8ZlpxYipD8ljSrnQNpRwliGAYMVGC9ljTu1QdRvy1HHSjO8upQPQHfnNWoQpYvJ4 +XIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726804803; x=1727409603; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0uw0OV+P+R3MfgO6fcG8gkEPgZNIDvClM8Ygg6sQ+Qw=; b=hrIxKrmOA3H1LduJ4H0v5eKOVIcZK0dFeKY4RLUXvgNfO99UAQvaWtRPXqay1QOIxG 5PycHPsbV4NtL+yhrM4YiNuJx3aXnTG8TXQ04YYbj1QIpvFyP+jlGll6rmKq+zi7Tnib qsCxQPhfiub6rTP/lUBrKlNWfHCsJ5hJMt2oZGfNJQT/xiGOz1ZWeLMP9z4YDo6waYJV 7xQt2NSygJuxW4L0RbsgawRHsB0ANABg2BA+ztevqOKn/T82uzOgGTeIzB1MJr+qcpgl baWBLudWR4u2zwsbiWYYcIetVaj53381QtFopexmdMtfFX/eUaPjGkZPB2vfrDz7o/iL x6ng== X-Forwarded-Encrypted: i=1; AJvYcCVaD//tckmDVFi7i76luT2CBg+LpaNvRlBo3+79dsqI53wgcZERixj6sx/fiynHZkGdXx/M6lA26qmSXu5x@lists.postgresql.org X-Gm-Message-State: AOJu0YyIs0uM0XBrXvhkz/49v8YxuR+EL6wcCpqP2joRbo5FXmbpocir igw9IHDXVfNh0b4OTCpLM5adRxnrrkYpONJfEup4zQgK8hLyx9tW X-Google-Smtp-Source: AGHT+IG54awWIaeziJ7dFXriQLNwBsUpg/1H5wFHbIBlroJLDC3HSjoQqbZwSp2IRslIAZtQSwvXZQ== X-Received: by 2002:a05:6512:1105:b0:533:ad6:8119 with SMTP id 2adb3069b0e04-536ac2e1c8cmr741964e87.14.1726804802747; Thu, 19 Sep 2024 21:00:02 -0700 (PDT) Received: from [1.0.0.7] ([178.155.18.41]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a465esm2008184e87.198.2024.09.19.21.00.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Sep 2024 21:00:01 -0700 (PDT) Message-ID: Date: Fri, 20 Sep 2024 07:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Large expressions in indexes can't be stored (non-TOASTable) To: Nathan Bossart Cc: Tom Lane , "Jonathan S. Katz" , PostgreSQL Hackers , Michael Paquier References: <1679756.1725476893@sss.pgh.pa.us> <1812111.1726671296@sss.pgh.pa.us> Content-Language: en-US From: Alexander Lakhin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Nathan, 19.09.2024 21:36, Nathan Bossart wrote: > On Thu, Sep 19, 2024 at 12:00:00PM +0300, Alexander Lakhin wrote: >> completed with: >> DROP INDEX CONCURRENTLY def_vec_quantizer_idx; >> >> triggers an assertion failure: >> TRAP: failed Assert("HaveRegisteredOrActiveSnapshot()"), File: "toast_internals.c", Line: 668, PID: 3723372 > Ha, that was fast. The attached patch seems to fix the assertion failures. > It's probably worth checking if any of the adjacent code paths are > affected, too. > Thank you for your attention to that issue! I've found another two paths to reach that condition: CREATE INDEX CONCURRENTLY ON def (vec_quantizer(id, :'b')); ERROR:  cannot fetch toast data without an active snapshot REINDEX INDEX CONCURRENTLY def_vec_quantizer_idx; (or REINDEX TABLE CONCURRENTLY def;) TRAP: failed Assert("HaveRegisteredOrActiveSnapshot()"), File: "toast_internals.c", Line: 668, PID: 2934502 ExceptionalCondition at assert.c:52:13 init_toast_snapshot at toast_internals.c:670:2 toast_delete_datum at toast_internals.c:429:60 toast_tuple_cleanup at toast_helper.c:303:30 heap_toast_insert_or_update at heaptoast.c:335:9 heap_update at heapam.c:3752:14 simple_heap_update at heapam.c:4210:11 CatalogTupleUpdate at indexing.c:324:2 index_concurrently_swap at index.c:1649:2 ReindexRelationConcurrently at indexcmds.c:4270:3 ReindexIndex at indexcmds.c:2962:1 ExecReindex at indexcmds.c:2884:4 ProcessUtilitySlow at utility.c:1570:22 ... Perhaps it would make sense to check all CatalogTupleUpdate(pg_index, ...) calls (I've found 10 such instances, but haven't checked them yet). Best regards, Alexander