Error 'read beyond eof in table' when running SELECT query on partitioned table
search cancel

Error 'read beyond eof in table' when running SELECT query on partitioned table

book

Article ID: 296892

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

When attempting a select on a partitioned table, the error "read beyond eof in table XXXXX" below is seen:
2023-10-11 16:57:15.191445 PDT,"pivotal","test1",p3241626,th-1132627584,"[local]",,2023-10-11 16:57:14 PDT,0,con86,cmd2,seg-1,,,,sx1,"ERROR","XX000","read beyond eof in table ""test_vacuum_prt_1_prt_3"" file ""base/219425/118627.1"", read position 0 (small offset 0), actual read length 0 (large rea     d length 65536) (cdbbufferedread.c:202)  (seg0 slice1 127.0.1.1:6002 pid=3241628) (cdbbufferedread.c:202)",,,,,,"select count(*) from test_vacuum_prt",0,,"cdbbufferedread.c",202,"Stack trace:
1    0x55ac7eb62b0d postgres errstart + 0x473
2    0x55ac7ec376a5 postgres cdbdisp_get_PQerror + 0x12b
3    0x55ac7ec374b5 postgres cdbdisp_dumpDispatchResult + 0x5b
4    0x55ac7ec3794d postgres cdbdisp_dumpDispatchResults + 0x104
5    0x55ac7ec332cb postgres cdbdisp_getDispatchResults + 0xc2
6    0x55ac7ec3348b postgres CdbDispatchHandleError + 0x1ab
7    0x55ac7e775382 postgres mppExecutorCleanup + 0xef
8    0x55ac7e7532f5 postgres standard_ExecutorRun + 0x5b5
9    0x55ac7e752d3d postgres ExecutorRun + 0x54
10   0x55ac7e9d5986 postgres <symbol not found> + 0x7e9d5986
11   0x55ac7e9d5576 postgres PortalRun + 0x30a
12   0x55ac7e9cc756 postgres <symbol not found> + 0x7e9cc756
13   0x55ac7e9d2376 postgres PostgresMain + 0xe31
14   0x55ac7e92a641 postgres <symbol not found> + 0x7e92a641
15   0x55ac7e929b6e postgres <symbol not found> + 0x7e929b6e
16   0x55ac7e925279 postgres <symbol not found> + 0x7e925279
17   0x55ac7e924575 postgres PostmasterMain + 0x1568
18   0x55ac7e8052a1 postgres <symbol not found> + 0x7e8052a1
19   0x7fc3bf395d90 libc.so.6 <symbol not found> + 0xbf395d90
20   0x7fc3bf395e40 libc.so.6 __libc_start_main + 0x80
21   0x55ac7e449205 postgres _start + 0x25
This error occurs when a vacuum on one of the partitions is concurrently running during the time of the SELECT statement.

For more info see: https://github.com/greenplum-db/gpdb/issues/16545

Environment

Product Version: 6.23

Resolution

As of October 30, 2023, fix is still pending.

Current workarounds are to:
  • avoid vacuum of partition tables during select
  • enclose select in a begin/end block, including a table lock beforehand:
    begin;
    lock table foo in access share mode;
    select count(*) from foo;
    end;