Giter Site home page Giter Site logo

Comments (3)

ashwinstar avatar ashwinstar commented on June 13, 2024

Thanks for report @danielwestermann team has stared to look into the reported issue, as of now its not expected to see this error. Will provide update.

from gpdb.

soumyadeep2007 avatar soumyadeep2007 commented on June 13, 2024

The stack trace is:

heap_update_internal heapam.c:3226
simple_heap_update heapam.c:4107
CatalogTupleUpdate indexing.c:286
AppendOnlyVisimapStore_Store appendonly_visimap_store.c:156
AppendOnlyVisimap_Store appendonly_visimap.c:234
AppendOnlyVisimap_IsVisible appendonly_visimap.c:205
AppendOnlyVisimap_UniqueCheck appendonly_visimap.h:198
appendonly_index_unique_check appendonlyam_handler.c:685
table_index_unique_check tableam.h:1209
table_index_fetch_tuple_check tableam.c:213
_bt_check_unique nbtinsert.c:461
_bt_doinsert nbtinsert.c:256
btinsert nbtree.c:285
index_insert indexam.c:191
ExecInsertIndexTuples execIndexing.c:403
ExecUpdate nodeModifyTable.c:1718
ExecModifyTable nodeModifyTable.c:2689
...

from gpdb.

soumyadeep2007 avatar soumyadeep2007 commented on June 13, 2024

More minimal repro:

CREATE TABLE uao_unique_index_update_1 (a INT unique, b INT) USING ao_row DISTRIBUTED REPLICATED;
INSERT INTO uao_unique_index_update_1 SELECT a, 1 FROM generate_series (1, 32768) a;
UPDATE uao_unique_index_update_1 SET b = 2;
-- If we were to select the contents of the visimap relation on any of the
-- segments we would see 2 entries at this point, one with first_row_no = 0 and
-- the other with first_row_no = 32768.
UPDATE uao_unique_index_update_1 SET b = 3;
ERROR:  attempted to update invisible tuple  (seg0 127.0.1.1:7002 pid=1100784)

Some notes of discussion w/ @ashwinstar yesterday:

(1) The main issue is that we are trying to AppendOnlyVisimapStore_Store a visimap row in the catalog (as part of ExecUpdate() -> ... -> uniq check, that was inserted earlier as a part of the appendonly_delete() operation within appendonly_tuple_update. Said row hasn't yet been persisted into the catalog (that stuff is done in appendonly_dml_finish -> appendonly_delete_finish -> AppendOnlyVisimapDelete_Finish, so there is no chance for AppendOnlyVisimapStore_Store to find it.

Probably, we need a version of AppendOnlyVisimapDelete_Hide without the AppendOnlyVisimapEntry_HideTuple at the end.

(2) What we should be doing instead is to be using the backing visimap htab and spill file used to manage visibility info, to answer the visibility check that is a part of the uniqueness check. Calling AppendOnlyVisimap_IsVisible has the unfortunate side effect of "storing" a dirty visimap entry.

(3) Using the VisimapDelete infrastructure as mentioned in (2) is going to be a tad tricky, since that is not exposed very well at this layer.

from gpdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.