cstore_fdw icon indicating copy to clipboard operation
cstore_fdw copied to clipboard

Drop statement leaves table in inconsistent state after rollback

Open asdf-qwert opened this issue 5 years ago • 2 comments

Hello, I have ran into issue with dropping cstore table and then rollbacking the transaction. Rollback leaves the table in an inconsistent state as the table definition still exists (which is correct), but cstore data files are deleted and not rolled back with the rest of the transaction. Steps to reproduce:

-- create empty cstore table
create foreign table cstore_drop_test()
    server cstore_server;

-- query without errors
select * from cstore_drop_test;

-- drop cstore table and then rollback
DO language plpgsql
$$
    DECLARE
    BEGIN
        drop foreign table cstore_drop_test;
        rollback;
    END
$$;

-- query fails on 'could not open file "xxx.footer" for reading'
select * from cstore_drop_test;

asdf-qwert avatar Sep 17 '19 06:09 asdf-qwert

yes, unfortunately this is a known issue that won't be fixed. It involves a file operation that can not be rolled back.

mtuncer avatar Sep 17 '19 07:09 mtuncer

We have added a different storage mechanism that is pending release under develop branch. This should solve the truncate issue you are having.

But it is not of release quality yet at this time

mtuncer avatar Sep 17 '19 07:09 mtuncer