andr-sokolov opened a new issue, #1746:
URL: https://github.com/apache/cloudberry/issues/1746

   ### Apache Cloudberry version
   
   _No response_
   
   ### What happened
   
   ```c
   void
   TruncateAOSegmentFile(File fd, Relation rel, int32 segFileNum, int64 offset, 
AOVacuumRelStats *vacrelstats)
   {
        char *relname = RelationGetRelationName(rel);
        int64 filesize_before;
   
        Assert(fd > 0);
        Assert(offset >= 0);
   
        RelationOpenSmgr(rel);
   
        filesize_before = rel->rd_smgr->smgr_ao->smgr_FileSize(fd);
        if (filesize_before < offset)
                ereport(ERROR,
                                (errmsg("\"%s\": file size smaller than logical 
eof: %m",
                                                relname)));
   ```
   
   When the error happens, `filesize_before` is file size of the main fork of 
`pg_aocsseg`, and `offset` is size of the first column file.
   
   
   ### What you think should happen instead
   
   _No response_
   
   ### How to reproduce
   
   ```
   ttt=# CREATE TABLE test_sokolov
   (
   vendorid int8 NULL,
   pickup_date date NULL,
   tpep_pickup_dttm timestamp(0) NULL,
   tpep_dropoff_dttm timestamp(0) NULL,
   passenger_count bigint NULL,
   trip_distance float8 NULL,
   ratecodeid float8 NULL,
   store_and_fwd_flag bpchar(1) NULL,
   pulocationid int8 NULL,
   dolocationid int8 NULL,
   payment_type int8 NULL,
   fare_amount float8 NULL,
   extra float8 NULL,
   mta_tax float8 NULL,
   tip_amount float8 NULL,
   tolls_amount float8 NULL,
   improvement_surcharge float8 NULL,
   total_amount float8 NULL,
   congestion_surcharge float8 NULL,
   airport_fee float8 NULL
   )
   with
   (
   appendoptimized=true,
   orientation=column,
   compresstype=ZLIB,
   compresslevel=6
   )
   DISTRIBUTED RANDOMLY
   PARTITION BY RANGE(pickup_date)
   (
           START (date '2013-01-01') INCLUSIVE
           END (date '2025-01-01') EXCLUSIVE
           EVERY (INTERVAL '1 year'),
           default partition other
   );
   CREATE TABLE
   ttt=# insert into test_sokolov values (1, now(), now(), now(), 1, 1, 1, '1', 
1,1,1, 1,1,1, 1,1,1, 1,1,1);
   INSERT 0 1
   ttt=# vacuum ANALYZE test_sokolov;
   ERROR:  "test_sokolov_1_prt_other": file size smaller than logical eof: 
Success (aomd.c:207)  (seg0 10.129.0.32:6000 pid=3454980) (aomd.c:207)
   ttt=# 
   ```
   
   The reproduction is not stable
   
   ### Operating System
   
   Ubuntu
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes, I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/cloudberry/blob/main/CODE_OF_CONDUCT.md).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to