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 1qvrXW-0080OI-9L for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Oct 2023 04:00:10 +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 1qvrXU-00CEuq-75 for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Oct 2023 04:00:08 +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 1qvrXT-00CEuh-TG for pgsql-hackers@lists.postgresql.org; Thu, 26 Oct 2023 04:00:07 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qvrXR-002rCv-9v for pgsql-hackers@postgresql.org; Thu, 26 Oct 2023 04:00:07 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-507a3b8b113so600310e87.0 for ; Wed, 25 Oct 2023 21:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698292803; x=1698897603; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=jaTZXFZaMOUwX+9kYyFs22rmdiFjQcb2D6cpKPQeyFg=; b=IFZ3bq35AqxnLFYCMD+qHGmLRgPokt9bEgrixu44zG0RB+KU0nPaCxe0nOVLCEug1K L6b/zhvWqsZDDdxJwTxD6Qra51GoeYghMPS7yuMtrRlkU21koP710c76WIQzpEY1P8Ap 2xgM8bdtKmXcBAH2QZ+5faGO/apxoLWb4UxTiaOp1s5xF78NL6O1xoyG6A/TvtZHZJwV JOXuloc21pq/XuJ8erjK0RONTUZrn9fNQXXddkNQYz5Q0/0qFpOIslK3NWMipQkaEX8U otfx7N2Fb0Bq29LQ7PBEKnySpEWVsyp89m3L+t1h8fwfPvFweJaTHFifuXChpGcSn+6N ZiPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698292803; x=1698897603; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jaTZXFZaMOUwX+9kYyFs22rmdiFjQcb2D6cpKPQeyFg=; b=nbBrUhSG5tQu430npcA95nXaSKb/M7fTTWx2Hw1gaIjytwQRatfy21Ww+NthQwiLp1 wYchalZi4ZL0xBwlKNn47u2Qys7jcu3Pcs+leVgEGF5h162OfWDzBjM3GS8L2eGlaXld ercc3qLL6HZKPSbCSzh2ZWPOSmEYWlBfer+86YkQCcBHHneymj/13HkBnyGD32l/oJDI oWtL17FNDhDktk4k6hsM4b9nVsoHhQk3ROfLbc81uh8haSTc+50sQAe7NhuuJt13Mw+p TYV+46U7RcZuEelOCRNLt9CTMAT7bY+4BiP+h7uCQ0jLiQ9eQx5ZvqIb+aS7KkQ7yFCS d0TQ== X-Gm-Message-State: AOJu0YxSypjrM1wuKR9+3jr5FCqx+IqL/bzEPmBx/9NsvsoNSF7joRAT u1gfB4lxsDVXISIBQG8/S3w= X-Google-Smtp-Source: AGHT+IH4gO0dN3BhXw4beS2RiD7RhUulfhQnoTkRaltpArwU9wfCHwxHh+SRrfyMa8rdAZxOd49G8A== X-Received: by 2002:ac2:430d:0:b0:502:d35b:5058 with SMTP id l13-20020ac2430d000000b00502d35b5058mr12490632lfh.4.1698292802737; Wed, 25 Oct 2023 21:00:02 -0700 (PDT) Received: from [1.0.0.7] ([178.155.28.40]) by smtp.gmail.com with ESMTPSA id h2-20020ac25962000000b005079ec79bfesm2830263lfp.93.2023.10.25.21.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Oct 2023 21:00:01 -0700 (PDT) Message-ID: Date: Thu, 26 Oct 2023 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: Is this a problem in GenericXLogFinish()? Content-Language: en-US To: Jeff Davis , Robert Haas Cc: Heikki Linnakangas , pgsql-hackers@postgresql.org References: <146426fc662f88604c700a72a3833b1919922f9e.camel@j-davis.com> <08b4f1f7dcf321d38373f06acc65a8d62cc2f017.camel@j-davis.com> <6d23aff2-7151-65b1-528b-2189ffa6e2df@iki.fi> <57c59f08bbb92875251dc97dbc47600fa237712c.camel@j-davis.com> <50bebdf8bbf79475e3fc0fff398d77b1577c1b97.camel@j-davis.com> <4b2dfe9c67713413a06be761f677bc34222afcb4.camel@j-davis.com> <23d87b531fab74e69fd753791a7e5047f17da9ab.camel@j-davis.com> From: Alexander Lakhin In-Reply-To: <23d87b531fab74e69fd753791a7e5047f17da9ab.camel@j-davis.com> 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 hackers, 24.10.2023 03:45, Jeff Davis wrote: > Committed. I've encountered a case with a hash index, when an assert added by the commit fails: CREATE TABLE t (i INT); CREATE INDEX hi ON t USING HASH (i); INSERT INTO t SELECT 1 FROM generate_series(1, 1000); BEGIN; INSERT INTO t SELECT 1 FROM generate_series(1, 1000); ROLLBACK; CHECKPOINT; VACUUM t; Leads to: Core was generated by `postgres: law regression [local] VACUUM                                       '. Program terminated with signal SIGABRT, Aborted. warning: Section `.reg-xstate/211944' in core file too small. #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=139924569388864) at ./nptl/pthread_kill.c:44 44      ./nptl/pthread_kill.c: No such file or directory. (gdb) bt #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=139924569388864) at ./nptl/pthread_kill.c:44 #1  __pthread_kill_internal (signo=6, threadid=139924569388864) at ./nptl/pthread_kill.c:78 #2  __GI___pthread_kill (threadid=139924569388864, signo=signo@entry=6) at ./nptl/pthread_kill.c:89 #3  0x00007f42b99ed476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #4  0x00007f42b99d37f3 in __GI_abort () at ./stdlib/abort.c:79 #5  0x000055f128e83f1b in ExceptionalCondition (conditionName=0x55f128f33520 "BufferIsExclusiveLocked(buffer) && BufferIsDirty(buffer)", fileName=0x55f128f333a8 "xloginsert.c", lineNumber=262) at assert.c:66 #6  0x000055f1287edce3 in XLogRegisterBuffer (block_id=1 '\001', buffer=1808, flags=8 '\b') at xloginsert.c:262 #7  0x000055f128742833 in _hash_freeovflpage (rel=0x7f42adb95c88, bucketbuf=1808, ovflbuf=1825, wbuf=1808, itups=0x7ffc3f18c010, itup_offsets=0x7ffc3f18bce0, tups_size=0x7ffc3f18ccd0, nitups=0, bstrategy=0x55f12a562820)     at hashovfl.c:671 #8  0x000055f128743567 in _hash_squeezebucket (rel=0x7f42adb95c88, bucket=6, bucket_blkno=7, bucket_buf=1808, bstrategy=0x55f12a562820) at hashovfl.c:1064 #9  0x000055f12873ca2a in hashbucketcleanup (rel=0x7f42adb95c88, cur_bucket=6, bucket_buf=1808, bucket_blkno=7, bstrategy=0x55f12a562820, maxbucket=7, highmask=15, lowmask=7, tuples_removed=0x7ffc3f18fb28,     num_index_tuples=0x7ffc3f18fb30, split_cleanup=false, callback=0x55f1289ba1de , callback_state=0x55f12a566778) at hash.c:921 #10 0x000055f12873bfcf in hashbulkdelete (info=0x7ffc3f18fc30, stats=0x0, callback=0x55f1289ba1de , callback_state=0x55f12a566778) at hash.c:549 #11 0x000055f128776fbb in index_bulk_delete (info=0x7ffc3f18fc30, istat=0x0, callback=0x55f1289ba1de , callback_state=0x55f12a566778) at indexam.c:709 #12 0x000055f1289ba03d in vac_bulkdel_one_index (ivinfo=0x7ffc3f18fc30, istat=0x0, dead_items=0x55f12a566778) at vacuum.c:2480 #13 0x000055f128771286 in lazy_vacuum_one_index (indrel=0x7f42adb95c88, istat=0x0, reltuples=-1, vacrel=0x55f12a4b9c30) at vacuumlazy.c:2768 #14 0x000055f1287704a3 in lazy_vacuum_all_indexes (vacrel=0x55f12a4b9c30) at vacuumlazy.c:2338 #15 0x000055f128770275 in lazy_vacuum (vacrel=0x55f12a4b9c30) at vacuumlazy.c:2256 ... It looks like the buffer is not dirty in the problematic call. Best regards, Alexander