From 11a5a8073f74a9213a92ff980c5b44b7a9afb725 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Sat, 18 Feb 2017 21:44:43 +0200 Subject: [PATCH] Move UAO isolation test cases from TINC to a new pg_regress based suite. This new "isolation2" suite uses the same Python helper that TINC used, to run these special isolation test cases. --- GNUmakefile.in | 1 + src/test/isolation2/Makefile | 47 ++ src/test/isolation2/README | 7 + .../expected/alter_while_vacuum.out} | 8 +- .../expected/alter_while_vacuum2.out | 39 ++ .../expected/compaction_full_stats.out} | 17 +- .../expected/compaction_utility.out} | 12 +- .../expected/compaction_utility_2.out} | 10 +- .../expected/compaction_utility_insert.out} | 18 +- .../expected/compaction_utility_insert_2.out} | 16 +- .../expected/cursor_before_delete.out} | 6 + .../expected/cursor_before_deletevacuum.out} | 8 +- .../expected/cursor_before_update.out} | 8 +- .../expected/cursor_withhold.out} | 8 +- .../expected/cursor_withhold2.out} | 8 +- .../expected/delete_while_vacuum.out} | 9 +- .../expected/drop_while_vacuum.out} | 8 +- .../isolation2/expected/insert_policy.out | 302 ++++++++++++ .../isolation2/expected/insert_policy_2.out | 300 ++++++++++++ .../expected/insert_while_vacuum.out | 65 +++ .../expected/locks_reindex.out} | 14 +- .../expected/locks_reindex_2.out} | 15 +- .../expected/max_concurrency.out} | 266 +++++------ .../expected/max_concurrency2.out} | 275 +++++------ .../expected/modcount.out} | 16 +- .../isolation2/expected/modcount_vacuum.out | 24 + .../expected/parallel_delete.out} | 16 +- .../expected/parallel_delete_2.out} | 14 +- .../expected/parallel_update.out} | 16 +- .../expected/parallel_update_2.out} | 15 +- .../parallel_update_readcommitted.out | 33 ++ .../expected/phantom_reads.out} | 8 +- .../expected/phantom_reads_delete.out} | 8 +- .../phantom_reads_delete_serializable.out} | 0 .../expected/phantom_reads_serializable.out} | 8 +- .../expected/phantom_reads_update.out} | 8 +- .../phantom_reads_update_serializable.out} | 0 .../expected/select_after_vacuum.out | 102 ++++ .../expected/select_after_vacuum_2.out | 102 ++++ .../select_after_vacuum_serializable.out | 75 +++ .../expected/select_before_delete.out} | 0 .../expected/select_before_vacuum.out | 80 ++++ .../expected/select_while_delete.out} | 10 +- .../expected/select_while_delete_2.out} | 9 +- .../expected/select_while_full_vacuum.out | 60 +++ .../expected/select_while_vacuum.out | 60 +++ .../select_while_vacuum_serializable.out | 62 +++ .../select_while_vacuum_serializable2.out | 79 ++++ .../select_while_vacuum_serializable2_2.out | 79 ++++ .../expected/selectinsert_while_vacuum.out} | 48 +- .../selectinsertupdate_while_vacuum.out} | 8 +- .../expected/selectupdate_while_vacuum.out | 74 +++ .../expected/update_while_vacuum.out} | 8 +- .../expected/vacuum_self_serializable.out} | 10 +- .../expected/vacuum_self_serializable2.out} | 16 +- .../expected/vacuum_self_serializable3.out} | 16 +- .../expected/vacuum_while_insert.out} | 48 +- .../expected/vacuum_while_vacuum.out | 38 ++ src/test/isolation2/isolation2_main.c | 95 ++++ src/test/isolation2/isolation2_schedule | 45 ++ .../sql/alter_while_vacuum.sql | 3 + .../sql/alter_while_vacuum2.sql} | 12 +- .../sql/compaction_full_stats.sql | 9 +- .../isolation2/sql/compaction_utility.sql | 12 + .../sql/compaction_utility_insert.sql | 18 + .../sql/cursor_before_delete.sql | 3 + .../sql/cursor_before_deletevacuum.sql | 3 + .../sql/cursor_before_update.sql | 3 + .../sql/cursor_withhold.sql | 3 + .../sql/cursor_withhold2.sql | 3 + .../sql/delete_while_vacuum.sql | 4 + .../sql/drop_while_vacuum.sql | 3 + .../sql/insert_policy.sql} | 21 +- .../sql/insert_while_vacuum.sql | 23 + .../sql/locks_reindex.sql} | 22 +- .../sql/max_concurrency.sql | 4 +- .../sql/max_concurrency2.sql | 12 +- src/test/isolation2/sql/modcount.sql | 13 + src/test/isolation2/sql/modcount_vacuum.sql | 10 + .../sql/parallel_delete.sql} | 21 +- .../sql/parallel_update.sql} | 19 +- .../sql/parallel_update_readcommitted.sql} | 17 +- .../sql/phantom_reads.sql | 3 + .../sql/phantom_reads_delete.sql | 3 + .../sql/phantom_reads_serializable.sql | 3 + .../sql/phantom_reads_update.sql | 3 + .../sql/select_after_vacuum.sql} | 19 +- .../sql/select_after_vacuum_serializable.sql} | 13 +- .../sql/select_before_vacuum.sql} | 16 +- .../sql/select_while_delete.sql | 5 +- .../sql/select_while_full_vacuum.sql} | 12 +- .../isolation2/sql/select_while_vacuum.sql | 32 ++ .../sql/select_while_vacuum_serializable.sql} | 11 +- .../select_while_vacuum_serializable2.sql} | 15 +- .../sql/selectinsert_while_vacuum.sql | 23 + .../sql/selectinsertupdate_while_vacuum.sql | 3 + .../sql/selectupdate_while_vacuum.sql} | 19 +- .../sql/update_while_vacuum.sql | 3 + .../sql/vacuum_self_serializable.sql | 13 + .../sql/vacuum_self_serializable2.sql | 18 + .../sql/vacuum_self_serializable3.sql | 15 + .../sql/vacuum_while_insert.sql | 23 + .../sql/vacuum_while_vacuum.sql} | 14 +- src/test/isolation2/sql_isolation_testcase.py | 439 ++++++++++++++++++ .../storage/uao/uao_isolation/__init__.py | 0 .../expected/alter_while_vacuum2.ans | 22 - .../uao_isolation/expected/insert_policy.ans | 45 -- .../expected/insert_policy_2seg.ans | 45 -- .../expected/insert_while_vacuum.ans | 19 - .../expected/modcount_vacuum.ans | 18 - .../parallel_update_readcommitted.ans | 21 - .../expected/select_after_vacuum.ans | 44 -- .../expected/select_after_vacuum_2seg.ans | 45 -- .../select_after_vacuum_serializable.ans | 23 - .../expected/select_before_vacuum.ans | 29 -- .../expected/select_while_full_vacuum.ans | 14 - .../expected/select_while_vacuum.ans | 14 - .../select_while_vacuum_serializable.ans | 16 - .../select_while_vacuum_serializable2.ans | 33 -- ...select_while_vacuum_serializable2_2seg.ans | 33 -- .../expected/selectupdate_while_vacuum.ans | 38 -- .../expected/vacuum_while_vacuum.ans | 22 - .../uao_isolation/sql/alter_while_vacuum2.sql | 10 - .../sql/alter_while_vacuum_setup.sql | 8 - .../sql/compaction_full_stats_setup.sql | 11 - .../uao_isolation/sql/compaction_utility.sql | 8 - .../sql/compaction_utility_insert.sql | 15 - .../sql/compaction_utility_insert_setup.sql | 7 - .../sql/compaction_utility_setup.sql | 8 - .../sql/cursor_before_delete_setup.sql | 8 - .../sql/cursor_before_deletevacuum_setup.sql | 8 - .../sql/cursor_before_update_setup.sql | 8 - .../sql/cursor_withhold2_setup.sql | 8 - .../sql/cursor_withhold_setup.sql | 8 - .../sql/delete_while_vacuum_setup.sql | 8 - .../sql/drop_while_vacuum_setup.sql | 8 - .../uao/uao_isolation/sql/insert_policy.sql | 17 - .../uao/uao_isolation/sql/locks_reindex.sql | 22 - .../sql/max_concurrency2_setup.sql | 6 - .../sql/max_concurrency_setup.sql | 6 - .../uao/uao_isolation/sql/modcount.sql | 10 - .../uao/uao_isolation/sql/modcount_setup.sql | 8 - .../uao/uao_isolation/sql/modcount_vacuum.sql | 7 - .../sql/modcount_vacuum_setup.sql | 8 - .../uao/uao_isolation/sql/parallel_delete.sql | 16 - .../uao/uao_isolation/sql/parallel_update.sql | 14 - .../sql/parallel_update_readcommitted.sql | 12 - .../sql/phantom_reads_delete_setup.sql | 7 - .../sql/phantom_reads_serializable_setup.sql | 7 - .../uao_isolation/sql/phantom_reads_setup.sql | 7 - .../sql/phantom_reads_update_setup.sql | 7 - .../uao_isolation/sql/select_after_vacuum.sql | 14 - .../sql/select_after_vacuum_serializable.sql | 10 - .../sql/select_before_vacuum.sql | 12 - .../sql/select_while_delete_setup.sql | 8 - .../sql/select_while_full_vacuum.sql | 9 - .../uao_isolation/sql/select_while_vacuum.sql | 9 - .../sql/select_while_vacuum_serializable.sql | 8 - .../sql/select_while_vacuum_serializable2.sql | 12 - ...select_while_vacuum_serializable_setup.sql | 28 -- .../sql/select_while_vacuum_setup.sql | 28 -- .../sql/selectinsert_while_vacuum_setup.sql | 28 -- .../selectinsertupdate_while_vacuum_setup.sql | 7 - .../sql/selectupdate_while_vacuum.sql | 15 - .../sql/update_while_vacuum_setup.sql | 8 - .../sql/vacuum_self_serializable.sql | 10 - .../sql/vacuum_self_serializable2.sql | 13 - .../sql/vacuum_self_serializable2_setup.sql | 9 - .../sql/vacuum_self_serializable3.sql | 10 - .../sql/vacuum_self_serializable3_setup.sql | 9 - .../sql/vacuum_self_serializable_setup.sql | 7 - .../sql/vacuum_while_insert_setup.sql | 28 -- .../uao_isolation/sql/vacuum_while_vacuum.sql | 10 - .../uao/uao_isolation/test_uao_isolation.py | 51 -- 174 files changed, 3318 insertions(+), 1483 deletions(-) create mode 100644 src/test/isolation2/Makefile create mode 100644 src/test/isolation2/README rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/alter_while_vacuum.ans => isolation2/expected/alter_while_vacuum.out} (73%) create mode 100644 src/test/isolation2/expected/alter_while_vacuum2.out rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_full_stats.ans => isolation2/expected/compaction_full_stats.out} (64%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility.ans => isolation2/expected/compaction_utility.out} (50%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility_2seg.ans => isolation2/expected/compaction_utility_2.out} (50%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility_insert_2seg.ans => isolation2/expected/compaction_utility_insert.out} (62%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility_insert.ans => isolation2/expected/compaction_utility_insert_2.out} (62%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_before_delete.ans => isolation2/expected/cursor_before_delete.out} (81%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_before_deletevacuum.ans => isolation2/expected/cursor_before_deletevacuum.out} (82%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_before_update.ans => isolation2/expected/cursor_before_update.out} (78%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_withhold.ans => isolation2/expected/cursor_withhold.out} (79%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_withhold2.ans => isolation2/expected/cursor_withhold2.out} (81%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/delete_while_vacuum.ans => isolation2/expected/delete_while_vacuum.out} (67%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/drop_while_vacuum.ans => isolation2/expected/drop_while_vacuum.out} (67%) create mode 100644 src/test/isolation2/expected/insert_policy.out create mode 100644 src/test/isolation2/expected/insert_policy_2.out create mode 100644 src/test/isolation2/expected/insert_while_vacuum.out rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/locks_reindex.ans => isolation2/expected/locks_reindex.out} (83%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/locks_reindex_2seg.ans => isolation2/expected/locks_reindex_2.out} (81%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/max_concurrency.ans => isolation2/expected/max_concurrency.out} (50%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/max_concurrency2.ans => isolation2/expected/max_concurrency2.out} (50%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/modcount.ans => isolation2/expected/modcount.out} (51%) create mode 100644 src/test/isolation2/expected/modcount_vacuum.out rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_delete.ans => isolation2/expected/parallel_delete.out} (52%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_delete_2seg.ans => isolation2/expected/parallel_delete_2.out} (51%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_update.ans => isolation2/expected/parallel_update.out} (52%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_update_2seg.ans => isolation2/expected/parallel_update_2.out} (51%) create mode 100644 src/test/isolation2/expected/parallel_update_readcommitted.out rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads.ans => isolation2/expected/phantom_reads.out} (74%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_delete.ans => isolation2/expected/phantom_reads_delete.out} (74%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_delete_serializable.ans => isolation2/expected/phantom_reads_delete_serializable.out} (100%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_serializable.ans => isolation2/expected/phantom_reads_serializable.out} (76%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_update.ans => isolation2/expected/phantom_reads_update.out} (74%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_update_serializable.ans => isolation2/expected/phantom_reads_update_serializable.out} (100%) create mode 100644 src/test/isolation2/expected/select_after_vacuum.out create mode 100644 src/test/isolation2/expected/select_after_vacuum_2.out create mode 100644 src/test/isolation2/expected/select_after_vacuum_serializable.out rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_before_delete.ans => isolation2/expected/select_before_delete.out} (100%) create mode 100644 src/test/isolation2/expected/select_before_vacuum.out rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_delete.ans => isolation2/expected/select_while_delete.out} (78%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_delete_2seg.ans => isolation2/expected/select_while_delete_2.out} (76%) create mode 100644 src/test/isolation2/expected/select_while_full_vacuum.out create mode 100644 src/test/isolation2/expected/select_while_vacuum.out create mode 100644 src/test/isolation2/expected/select_while_vacuum_serializable.out create mode 100644 src/test/isolation2/expected/select_while_vacuum_serializable2.out create mode 100644 src/test/isolation2/expected/select_while_vacuum_serializable2_2.out rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/selectinsert_while_vacuum.ans => isolation2/expected/selectinsert_while_vacuum.out} (53%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/selectinsertupdate_while_vacuum.ans => isolation2/expected/selectinsertupdate_while_vacuum.out} (72%) create mode 100644 src/test/isolation2/expected/selectupdate_while_vacuum.out rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/update_while_vacuum.ans => isolation2/expected/update_while_vacuum.out} (68%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_self_serializable.ans => isolation2/expected/vacuum_self_serializable.out} (57%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_self_serializable2.ans => isolation2/expected/vacuum_self_serializable2.out} (55%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_self_serializable3.ans => isolation2/expected/vacuum_self_serializable3.out} (52%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_while_insert.ans => isolation2/expected/vacuum_while_insert.out} (63%) create mode 100644 src/test/isolation2/expected/vacuum_while_vacuum.out create mode 100644 src/test/isolation2/isolation2_main.c create mode 100644 src/test/isolation2/isolation2_schedule rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/alter_while_vacuum.sql (61%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum2_setup.sql => isolation2/sql/alter_while_vacuum2.sql} (62%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/compaction_full_stats.sql (52%) create mode 100644 src/test/isolation2/sql/compaction_utility.sql create mode 100644 src/test/isolation2/sql/compaction_utility_insert.sql rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/cursor_before_delete.sql (79%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/cursor_before_deletevacuum.sql (79%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/cursor_before_update.sql (75%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/cursor_withhold.sql (78%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/cursor_withhold2.sql (79%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/delete_while_vacuum.sql (62%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/drop_while_vacuum.sql (56%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_policy_setup.sql => isolation2/sql/insert_policy.sql} (86%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/insert_while_vacuum.sql (53%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/locks_reindex_setup.sql => isolation2/sql/locks_reindex.sql} (70%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/max_concurrency.sql (98%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/max_concurrency2.sql (94%) create mode 100644 src/test/isolation2/sql/modcount.sql create mode 100644 src/test/isolation2/sql/modcount_vacuum.sql rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_delete_setup.sql => isolation2/sql/parallel_delete.sql} (58%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update_setup.sql => isolation2/sql/parallel_update.sql} (59%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update_readcommitted_setup.sql => isolation2/sql/parallel_update_readcommitted.sql} (64%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/phantom_reads.sql (66%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/phantom_reads_delete.sql (67%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/phantom_reads_serializable.sql (71%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/phantom_reads_update.sql (67%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum_setup.sql => isolation2/sql/select_after_vacuum.sql} (78%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum_serializable_setup.sql => isolation2/sql/select_after_vacuum_serializable.sql} (79%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_before_vacuum_setup.sql => isolation2/sql/select_before_vacuum.sql} (84%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/select_while_delete.sql (69%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_full_vacuum_setup.sql => isolation2/sql/select_while_full_vacuum.sql} (65%) create mode 100644 src/test/isolation2/sql/select_while_vacuum.sql rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_while_vacuum_setup.sql => isolation2/sql/select_while_vacuum_serializable.sql} (81%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable2_setup.sql => isolation2/sql/select_while_vacuum_serializable2.sql} (70%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/selectinsert_while_vacuum.sql (56%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/selectinsertupdate_while_vacuum.sql (69%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectupdate_while_vacuum_setup.sql => isolation2/sql/selectupdate_while_vacuum.sql} (73%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/update_while_vacuum.sql (63%) create mode 100644 src/test/isolation2/sql/vacuum_self_serializable.sql create mode 100644 src/test/isolation2/sql/vacuum_self_serializable2.sql create mode 100644 src/test/isolation2/sql/vacuum_self_serializable3.sql rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation => isolation2}/sql/vacuum_while_insert.sql (67%) rename src/test/{tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_vacuum_setup.sql => isolation2/sql/vacuum_while_vacuum.sql} (70%) create mode 100644 src/test/isolation2/sql_isolation_testcase.py delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/__init__.py delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/alter_while_vacuum2.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/insert_policy.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/insert_policy_2seg.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/insert_while_vacuum.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/modcount_vacuum.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_update_readcommitted.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_after_vacuum.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_after_vacuum_2seg.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_after_vacuum_serializable.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_before_vacuum.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_full_vacuum.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum_serializable.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum_serializable2.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum_serializable2_2seg.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/selectupdate_while_vacuum.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_while_vacuum.ans delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum2.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_full_stats_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility_insert.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility_insert_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_delete_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_deletevacuum_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_update_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold2_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/delete_while_vacuum_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/drop_while_vacuum_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_policy.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/locks_reindex.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency2_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount_vacuum.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount_vacuum_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_delete.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update_readcommitted.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_delete_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_serializable_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_update_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum_serializable.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_before_vacuum.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_delete_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_full_vacuum.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable2.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsert_while_vacuum_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsertupdate_while_vacuum_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectupdate_while_vacuum.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/update_while_vacuum_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable2.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable2_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable3.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable3_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_insert_setup.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_vacuum.sql delete mode 100644 src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/test_uao_isolation.py diff --git a/GNUmakefile.in b/GNUmakefile.in index 66e9e67aaf..4ad195957b 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -118,6 +118,7 @@ installcheck-world: $(MAKE) -C src/test installcheck-good $(MAKE) -C src/test installcheck-bugbuster $(MAKE) -C src/test/isolation installcheck + $(MAKE) -C src/test/isolation2 installcheck $(MAKE) -C src/pl installcheck #$(MAKE) -C src/interfaces/ecpg installcheck #$(MAKE) -C contrib installcheck diff --git a/src/test/isolation2/Makefile b/src/test/isolation2/Makefile new file mode 100644 index 0000000000..33d926d136 --- /dev/null +++ b/src/test/isolation2/Makefile @@ -0,0 +1,47 @@ +# +# Makefile for isolation2 tests +# + +subdir = src/test/isolation2 +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global + +# where to find psql for testing an existing installation +PSQLDIR = $(bindir) + +ifeq ($(PORTNAME), win32) +LDLIBS += -lws2_32 +endif + +override CPPFLAGS := -I$(srcdir) -I$(libpq_srcdir) -I$(srcdir)/../regress $(CPPFLAGS) +override LDLIBS := $(libpq_pgport) $(LDLIBS) + +all: pg_isolation2_regress$(X) + +pg_regress.o: + $(MAKE) -C $(top_builddir)/src/test/regress pg_regress.o + rm -f $@ && $(LN_S) $(top_builddir)/src/test/regress/pg_regress.o . + +gpstringsubs.pl: + rm -f $@ && $(LN_S) $(top_builddir)/src/test/regress/gpstringsubs.pl + +gpdiff.pl: atmsort.pm explain.pm + rm -f $@ && $(LN_S) $(top_builddir)/src/test/regress/gpdiff.pl + +atmsort.pm: + rm -f $@ && $(LN_S) $(top_builddir)/src/test/regress/atmsort.pm + +explain.pm: + rm -f $@ && $(LN_S) $(top_builddir)/src/test/regress/explain.pm + +pg_isolation2_regress$(X): isolation2_main.o pg_regress.o + $(CC) $(CFLAGS) $^ $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@ + +clean distclean: + rm -f pg_isolation2_regress$(X) $(OBJS) isolation2_main.o + rm -f pg_regress.o + rm -f gpstringsubs.pl gpdiff.pl atmsort.pm explain.pm + rm -rf $(pg_regress_clean_files) + +installcheck: all gpdiff.pl gpstringsubs.pl + ./pg_isolation2_regress --psqldir='$(PSQLDIR)' --inputdir=$(srcdir) --schedule=$(srcdir)/isolation2_schedule diff --git a/src/test/isolation2/README b/src/test/isolation2/README new file mode 100644 index 0000000000..fcd3148197 --- /dev/null +++ b/src/test/isolation2/README @@ -0,0 +1,7 @@ +This directory contains additional "isolation"-style tests. That is, +tests that require multiple simultaneous connections to the database. + +Some of these could be moved to the main isolation test suite, in +src/test/isolation, but for historical reasons, these tests use a different +syntax for specifying the tests. See sql_isolation_testcase.py for more +details on the syntax. diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/alter_while_vacuum.ans b/src/test/isolation2/expected/alter_while_vacuum.out similarity index 73% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/alter_while_vacuum.ans rename to src/test/isolation2/expected/alter_while_vacuum.out index 4cd5a98cb5..6d736190c8 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/alter_while_vacuum.ans +++ b/src/test/isolation2/expected/alter_while_vacuum.out @@ -1,5 +1,11 @@ -- @Description Ensures that an alter table while a vacuum operation is ok --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; +INSERT 100000 DELETE FROM ao WHERE a < 12000; DELETE 11999 diff --git a/src/test/isolation2/expected/alter_while_vacuum2.out b/src/test/isolation2/expected/alter_while_vacuum2.out new file mode 100644 index 0000000000..37190996b7 --- /dev/null +++ b/src/test/isolation2/expected/alter_while_vacuum2.out @@ -0,0 +1,39 @@ +-- @Description Ensures that an alter table while a vacuum operation is ok +-- +DROP TABLE IF EXISTS ao; +DROP + +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; +INSERT 100000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; +INSERT 100000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; +INSERT 100000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; +INSERT 100000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; +INSERT 100000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; +INSERT 100000 + +DELETE FROM ao WHERE a < 12000; +DELETE 71994 +1: SELECT COUNT(*) FROM ao; +count +------ +528006 +(1 row) +2: set debug_appendonly_print_compaction=true; +SET +2>: VACUUM ao; +1: Alter table ao set with ( reorganize='true') distributed randomly; +ALTER +2<: <... completed> +VACUUM +1: SELECT COUNT(*) FROM ao WHERE a < 12010; +count +----- +60 +(1 row) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_full_stats.ans b/src/test/isolation2/expected/compaction_full_stats.out similarity index 64% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_full_stats.ans rename to src/test/isolation2/expected/compaction_full_stats.out index fe11318baa..60c4fea520 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_full_stats.ans +++ b/src/test/isolation2/expected/compaction_full_stats.out @@ -1,5 +1,18 @@ -- @Description Tests the behavior of full vacuum w.r.t. the pg_class statistics --- +-- +DROP TABLE IF EXISTS foo; +DROP + +CREATE TABLE foo (a INT, b INT, c CHAR(128)) WITH (appendonly=true) DISTRIBUTED BY (a); +CREATE +CREATE INDEX foo_index ON foo(b); +CREATE +INSERT INTO foo SELECT i as a, i as b, 'hello world' as c FROM generate_series(1, 50) AS i; +INSERT 50 +INSERT INTO foo SELECT i as a, i as b, 'hello world' as c FROM generate_series(51, 100) AS i; +INSERT 50 +ANALYZE foo; +ANALYZE -- ensure that the scan go through the index SET enable_seqscan=false; @@ -28,7 +41,7 @@ relname |reltuples ---------+--------- foo_index|85 (1 row) -SELECT segno, tupcount,state FROM gp_aoseg_name('foo'); +SELECT segno, tupcount,state FROM gp_toolkit.__gp_aoseg_name('foo'); segno|tupcount|state -----+--------+----- 1 |0 |1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility.ans b/src/test/isolation2/expected/compaction_utility.out similarity index 50% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility.ans rename to src/test/isolation2/expected/compaction_utility.out index 98a8955e77..836fcf48e0 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility.ans +++ b/src/test/isolation2/expected/compaction_utility.out @@ -1,5 +1,13 @@ -- @Description Tests the basic behavior of (lazy) vacuum when called from utility mode --- +-- +DROP TABLE IF EXISTS foo; +DROP +CREATE TABLE foo (a INT, b INT, c CHAR(128)) WITH (appendonly=true); +CREATE +CREATE INDEX foo_index ON foo(b); +CREATE +INSERT INTO foo SELECT i as a, 1 as b, 'hello world' as c FROM generate_series(1, 100) AS i; +INSERT 100 DELETE FROM foo WHERE a < 20; DELETE 19 @@ -15,7 +23,7 @@ count ----- 81 (1 row) -2U: SELECT segno, tupcount FROM gp_aoseg_name('foo'); +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('foo'); segno|tupcount -----+-------- 0 |81 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility_2seg.ans b/src/test/isolation2/expected/compaction_utility_2.out similarity index 50% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility_2seg.ans rename to src/test/isolation2/expected/compaction_utility_2.out index a0479f7bd9..d482bae21a 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility_2seg.ans +++ b/src/test/isolation2/expected/compaction_utility_2.out @@ -1,5 +1,13 @@ -- @Description Tests the basic behavior of (lazy) vacuum when called from utility mode -- +DROP TABLE IF EXISTS foo; +DROP +CREATE TABLE foo (a INT, b INT, c CHAR(128)) WITH (appendonly=true); +CREATE +CREATE INDEX foo_index ON foo(b); +CREATE +INSERT INTO foo SELECT i as a, 1 as b, 'hello world' as c FROM generate_series(1, 100) AS i; +INSERT 100 DELETE FROM foo WHERE a < 20; DELETE 19 @@ -15,7 +23,7 @@ count ----- 81 (1 row) -2U: SELECT segno, tupcount FROM gp_aoseg_name('foo'); +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('foo'); segno|tupcount -----+-------- 0 |40 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility_insert_2seg.ans b/src/test/isolation2/expected/compaction_utility_insert.out similarity index 62% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility_insert_2seg.ans rename to src/test/isolation2/expected/compaction_utility_insert.out index 99e3c45ca8..340e5d96ed 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility_insert_2seg.ans +++ b/src/test/isolation2/expected/compaction_utility_insert.out @@ -1,9 +1,15 @@ -- @Description Tests the compaction of data inserted in utility mode --- +-- +DROP TABLE IF EXISTS foo; +DROP +CREATE TABLE foo (a INT, b INT, c CHAR(128)) WITH (appendonly=true); +CREATE +CREATE INDEX foo_index ON foo(b); +CREATE INSERT INTO foo VALUES (1, 1, 'c'); INSERT 1 -SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); +SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); segno|tupcount|state -----+--------+----- 1 |1 |1 @@ -12,14 +18,14 @@ segno|tupcount|state INSERT 1 2U: INSERT INTO foo VALUES (3, 3, 'c'); INSERT 1 -2U: SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); +2U: SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); segno|tupcount|state -----+--------+----- 0 |2 |1 1 |1 |1 (2 rows) -- We know that the master does update its tupcount yet -SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); +SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); segno|tupcount|state -----+--------+----- 1 |1 |1 @@ -30,7 +36,7 @@ UPDATE foo SET b = -1 WHERE a = 3; UPDATE 1 VACUUM foo; VACUUM -2U: SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); +2U: SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); segno|tupcount|state -----+--------+----- 0 |0 |1 @@ -38,7 +44,7 @@ segno|tupcount|state 2 |1 |1 3 |0 |1 (4 rows) -SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); +SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); segno|tupcount|state -----+--------+----- 1 |2 |1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility_insert.ans b/src/test/isolation2/expected/compaction_utility_insert_2.out similarity index 62% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility_insert.ans rename to src/test/isolation2/expected/compaction_utility_insert_2.out index 99e3c45ca8..7cd7749980 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/compaction_utility_insert.ans +++ b/src/test/isolation2/expected/compaction_utility_insert_2.out @@ -1,9 +1,15 @@ -- @Description Tests the compaction of data inserted in utility mode -- +DROP TABLE IF EXISTS foo; +DROP +CREATE TABLE foo (a INT, b INT, c CHAR(128)) WITH (appendonly=true); +CREATE +CREATE INDEX foo_index ON foo(b); +CREATE INSERT INTO foo VALUES (1, 1, 'c'); INSERT 1 -SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); +SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); segno|tupcount|state -----+--------+----- 1 |1 |1 @@ -12,14 +18,14 @@ segno|tupcount|state INSERT 1 2U: INSERT INTO foo VALUES (3, 3, 'c'); INSERT 1 -2U: SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); +2U: SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); segno|tupcount|state -----+--------+----- 0 |2 |1 1 |1 |1 (2 rows) -- We know that the master does update its tupcount yet -SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); +SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); segno|tupcount|state -----+--------+----- 1 |1 |1 @@ -30,7 +36,7 @@ UPDATE foo SET b = -1 WHERE a = 3; UPDATE 1 VACUUM foo; VACUUM -2U: SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); +2U: SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); segno|tupcount|state -----+--------+----- 0 |0 |1 @@ -38,7 +44,7 @@ segno|tupcount|state 2 |1 |1 3 |0 |1 (4 rows) -SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); +SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); segno|tupcount|state -----+--------+----- 1 |2 |1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_before_delete.ans b/src/test/isolation2/expected/cursor_before_delete.out similarity index 81% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_before_delete.ans rename to src/test/isolation2/expected/cursor_before_delete.out index a9764acd7e..b49d36369b 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_before_delete.ans +++ b/src/test/isolation2/expected/cursor_before_delete.out @@ -1,5 +1,11 @@ -- @Description Tests the visibility when a cursor has been created before the delete. -- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1, 100); +INSERT 100 1: BEGIN; BEGIN diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_before_deletevacuum.ans b/src/test/isolation2/expected/cursor_before_deletevacuum.out similarity index 82% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_before_deletevacuum.ans rename to src/test/isolation2/expected/cursor_before_deletevacuum.out index 0c88a3f680..6e6ad3f5e2 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_before_deletevacuum.ans +++ b/src/test/isolation2/expected/cursor_before_deletevacuum.out @@ -1,5 +1,11 @@ -- @Description Tests the visibility when a cursor has been created before the delete. --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1, 10); +INSERT 10 1: BEGIN; BEGIN diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_before_update.ans b/src/test/isolation2/expected/cursor_before_update.out similarity index 78% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_before_update.ans rename to src/test/isolation2/expected/cursor_before_update.out index b3b559118d..1b867e6f5a 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_before_update.ans +++ b/src/test/isolation2/expected/cursor_before_update.out @@ -1,5 +1,11 @@ -- @Description Tests the visibility when a cursor has been created before the update. --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,100) AS i; +INSERT 100 1: BEGIN; BEGIN diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_withhold.ans b/src/test/isolation2/expected/cursor_withhold.out similarity index 79% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_withhold.ans rename to src/test/isolation2/expected/cursor_withhold.out index 3aab1c186e..7cd0820c1a 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_withhold.ans +++ b/src/test/isolation2/expected/cursor_withhold.out @@ -1,5 +1,11 @@ -- @Description Tests the visibility of an "with hold" cursor w.r.t. deletes. --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,100); +INSERT 100 1: DECLARE cur CURSOR WITH HOLD FOR SELECT a FROM ao ORDER BY a; DECLARE diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_withhold2.ans b/src/test/isolation2/expected/cursor_withhold2.out similarity index 81% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_withhold2.ans rename to src/test/isolation2/expected/cursor_withhold2.out index ba61b59d35..9bc362ffd9 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/cursor_withhold2.ans +++ b/src/test/isolation2/expected/cursor_withhold2.out @@ -1,5 +1,11 @@ -- @Description Tests the visibility of an "with hold" cursor w.r.t. deletes. --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,10); +INSERT 10 1: BEGIN; BEGIN diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/delete_while_vacuum.ans b/src/test/isolation2/expected/delete_while_vacuum.out similarity index 67% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/delete_while_vacuum.ans rename to src/test/isolation2/expected/delete_while_vacuum.out index 25d6864ae1..2937005cd9 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/delete_while_vacuum.ans +++ b/src/test/isolation2/expected/delete_while_vacuum.out @@ -1,5 +1,12 @@ -- @Description Ensures that a delete before a vacuum operation is ok --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; +INSERT 100 + DELETE FROM ao WHERE a < 12; DELETE 11 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/drop_while_vacuum.ans b/src/test/isolation2/expected/drop_while_vacuum.out similarity index 67% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/drop_while_vacuum.ans rename to src/test/isolation2/expected/drop_while_vacuum.out index 13c4efecca..9055d5987f 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/drop_while_vacuum.ans +++ b/src/test/isolation2/expected/drop_while_vacuum.out @@ -1,5 +1,11 @@ -- @Description Ensures that a drop table while a vacuum operation is ok --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; +INSERT 100000 DELETE FROM ao WHERE a < 12000; DELETE 11999 diff --git a/src/test/isolation2/expected/insert_policy.out b/src/test/isolation2/expected/insert_policy.out new file mode 100644 index 0000000000..750fdd9335 --- /dev/null +++ b/src/test/isolation2/expected/insert_policy.out @@ -0,0 +1,302 @@ +-- @Description Tests the AO segment file selection policy +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 + +-- Actual test begins +1: INSERT INTO AO VALUES (1); +INSERT 1 +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |127 +(1 row) +1: INSERT INTO AO VALUES (2); +INSERT 1 +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |128 +(1 row) +1: BEGIN; +BEGIN +1: INSERT INTO AO VALUES (2); +INSERT 1 +2: BEGIN; +BEGIN +2: INSERT INTO AO VALUES (2); +INSERT 1 +1: COMMIT; +COMMIT +2: COMMIT; +COMMIT +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |129 +2 | 1 +(2 rows) +1: insert into ao select generate_series(1,100000); +INSERT 100000 +1: INSERT INTO AO VALUES (2); +INSERT 1 +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 | 100129 +2 | 2 +(2 rows) diff --git a/src/test/isolation2/expected/insert_policy_2.out b/src/test/isolation2/expected/insert_policy_2.out new file mode 100644 index 0000000000..0d4e2143c6 --- /dev/null +++ b/src/test/isolation2/expected/insert_policy_2.out @@ -0,0 +1,300 @@ +-- @Description Tests the AO segment file selection policy +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 +1: INSERT INTO AO VALUES (1); +INSERT 1 + +-- Actual test begins +1: INSERT INTO AO VALUES (1); +INSERT 1 +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |127 +(1 row) +1: INSERT INTO AO VALUES (2); +INSERT 1 +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |127 +(1 row) +1: BEGIN; +BEGIN +1: INSERT INTO AO VALUES (2); +INSERT 1 +2: BEGIN; +BEGIN +2: INSERT INTO AO VALUES (2); +INSERT 1 +1: COMMIT; +COMMIT +2: COMMIT; +COMMIT +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |127 +(1 row) +1: insert into ao select generate_series(1,100000); +INSERT 100000 +1: INSERT INTO AO VALUES (2); +INSERT 1 +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |50128 +(1 row) diff --git a/src/test/isolation2/expected/insert_while_vacuum.out b/src/test/isolation2/expected/insert_while_vacuum.out new file mode 100644 index 0000000000..eac4402c31 --- /dev/null +++ b/src/test/isolation2/expected/insert_while_vacuum.out @@ -0,0 +1,65 @@ +-- @Description Ensures that an insert during a vacuum operation is ok +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 + +DELETE FROM ao WHERE a < 128; +DELETE 2667 +2>: VACUUM ao; +4: BEGIN; +BEGIN +4: insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);COMMIT; +INSERT +2<: <... completed> +VACUUM +3: SELECT COUNT(*) FROM ao WHERE a = 1500; +count +----- +20 +(1 row) +4: INSERT INTO ao VALUES (0); +INSERT 1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/locks_reindex.ans b/src/test/isolation2/expected/locks_reindex.out similarity index 83% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/locks_reindex.ans rename to src/test/isolation2/expected/locks_reindex.out index f006ddddda..b9d54cc9be 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/locks_reindex.ans +++ b/src/test/isolation2/expected/locks_reindex.out @@ -1,7 +1,17 @@ -- @Description The locks held after different operations --- --- @product_version gpdb: 4.3.3.0O2 +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; +INSERT 100 +DROP VIEW IF EXISTS locktest; +DROP +create view locktest as select coalesce( case when relname like 'pg_toast%index' then 'toast index' when relname like 'pg_toast%' then 'toast table' when relname like 'pg_aovisimap%index' then 'visimap index' when relname like 'pg_aovisimap%' then 'visimap table' when relname like 'pg_aoseg%index' then 'aoseg index' when relname like 'pg_aoseg%' then 'aoseg table' when relname like 'pg_aocsseg%index' then 'aoseg index' when relname like 'pg_aocsseg%' then 'aoseg table' else relname end, 'dropped table'), mode, locktype from pg_locks l, pg_class c, pg_database d where relation is not null and l.database = d.oid and l.relation = c.oid and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; +CREATE + +-- Actual test begins 1: BEGIN; BEGIN 1: INSERT INTO ao VALUES (200, 200); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/locks_reindex_2seg.ans b/src/test/isolation2/expected/locks_reindex_2.out similarity index 81% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/locks_reindex_2seg.ans rename to src/test/isolation2/expected/locks_reindex_2.out index 029fb898a6..5174f5e9e0 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/locks_reindex_2seg.ans +++ b/src/test/isolation2/expected/locks_reindex_2.out @@ -1,7 +1,17 @@ -- @Description The locks held after different operations --- --- @product_version gpdb: 4.3.3.0O2 +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; +INSERT 100 +DROP VIEW IF EXISTS locktest; +DROP +create view locktest as select coalesce( case when relname like 'pg_toast%index' then 'toast index' when relname like 'pg_toast%' then 'toast table' when relname like 'pg_aovisimap%index' then 'visimap index' when relname like 'pg_aovisimap%' then 'visimap table' when relname like 'pg_aoseg%index' then 'aoseg index' when relname like 'pg_aoseg%' then 'aoseg table' when relname like 'pg_aocsseg%index' then 'aoseg index' when relname like 'pg_aocsseg%' then 'aoseg table' else relname end, 'dropped table'), mode, locktype from pg_locks l, pg_class c, pg_database d where relation is not null and l.database = d.oid and l.relation = c.oid and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; +CREATE + +-- Actual test begins 1: BEGIN; BEGIN 1: INSERT INTO ao VALUES (200, 200); @@ -92,4 +102,3 @@ pg_locks |AccessShareLock|relation (5 rows) 1: COMMIT; COMMIT - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/max_concurrency.ans b/src/test/isolation2/expected/max_concurrency.out similarity index 50% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/max_concurrency.ans rename to src/test/isolation2/expected/max_concurrency.out index bb90d34137..8c5c4247c9 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/max_concurrency.ans +++ b/src/test/isolation2/expected/max_concurrency.out @@ -1,5 +1,9 @@ -- @Description Insert into a ao relation with 127 concurrent transactions --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE 1: BEGIN; BEGIN @@ -894,134 +898,134 @@ a|b 1|1 1|1 (127 rows) -SELECT * FROM gp_aoseg_name('ao') ORDER BY segno; -segno|eof|tupcount|varblockcount|eofuncompressed|modcount|formatversion|state ------+---+--------+-------------+---------------+--------+-------------+----- -1 |0 |1 |0 |0 |1 |3 |1 -2 |0 |1 |0 |0 |1 |3 |1 -3 |0 |1 |0 |0 |1 |3 |1 -4 |0 |1 |0 |0 |1 |3 |1 -5 |0 |1 |0 |0 |1 |3 |1 -6 |0 |1 |0 |0 |1 |3 |1 -7 |0 |1 |0 |0 |1 |3 |1 -8 |0 |1 |0 |0 |1 |3 |1 -9 |0 |1 |0 |0 |1 |3 |1 -10 |0 |1 |0 |0 |1 |3 |1 -11 |0 |1 |0 |0 |1 |3 |1 -12 |0 |1 |0 |0 |1 |3 |1 -13 |0 |1 |0 |0 |1 |3 |1 -14 |0 |1 |0 |0 |1 |3 |1 -15 |0 |1 |0 |0 |1 |3 |1 -16 |0 |1 |0 |0 |1 |3 |1 -17 |0 |1 |0 |0 |1 |3 |1 -18 |0 |1 |0 |0 |1 |3 |1 -19 |0 |1 |0 |0 |1 |3 |1 -20 |0 |1 |0 |0 |1 |3 |1 -21 |0 |1 |0 |0 |1 |3 |1 -22 |0 |1 |0 |0 |1 |3 |1 -23 |0 |1 |0 |0 |1 |3 |1 -24 |0 |1 |0 |0 |1 |3 |1 -25 |0 |1 |0 |0 |1 |3 |1 -26 |0 |1 |0 |0 |1 |3 |1 -27 |0 |1 |0 |0 |1 |3 |1 -28 |0 |1 |0 |0 |1 |3 |1 -29 |0 |1 |0 |0 |1 |3 |1 -30 |0 |1 |0 |0 |1 |3 |1 -31 |0 |1 |0 |0 |1 |3 |1 -32 |0 |1 |0 |0 |1 |3 |1 -33 |0 |1 |0 |0 |1 |3 |1 -34 |0 |1 |0 |0 |1 |3 |1 -35 |0 |1 |0 |0 |1 |3 |1 -36 |0 |1 |0 |0 |1 |3 |1 -37 |0 |1 |0 |0 |1 |3 |1 -38 |0 |1 |0 |0 |1 |3 |1 -39 |0 |1 |0 |0 |1 |3 |1 -40 |0 |1 |0 |0 |1 |3 |1 -41 |0 |1 |0 |0 |1 |3 |1 -42 |0 |1 |0 |0 |1 |3 |1 -43 |0 |1 |0 |0 |1 |3 |1 -44 |0 |1 |0 |0 |1 |3 |1 -45 |0 |1 |0 |0 |1 |3 |1 -46 |0 |1 |0 |0 |1 |3 |1 -47 |0 |1 |0 |0 |1 |3 |1 -48 |0 |1 |0 |0 |1 |3 |1 -49 |0 |1 |0 |0 |1 |3 |1 -50 |0 |1 |0 |0 |1 |3 |1 -51 |0 |1 |0 |0 |1 |3 |1 -52 |0 |1 |0 |0 |1 |3 |1 -53 |0 |1 |0 |0 |1 |3 |1 -54 |0 |1 |0 |0 |1 |3 |1 -55 |0 |1 |0 |0 |1 |3 |1 -56 |0 |1 |0 |0 |1 |3 |1 -57 |0 |1 |0 |0 |1 |3 |1 -58 |0 |1 |0 |0 |1 |3 |1 -59 |0 |1 |0 |0 |1 |3 |1 -60 |0 |1 |0 |0 |1 |3 |1 -61 |0 |1 |0 |0 |1 |3 |1 -62 |0 |1 |0 |0 |1 |3 |1 -63 |0 |1 |0 |0 |1 |3 |1 -64 |0 |1 |0 |0 |1 |3 |1 -65 |0 |1 |0 |0 |1 |3 |1 -66 |0 |1 |0 |0 |1 |3 |1 -67 |0 |1 |0 |0 |1 |3 |1 -68 |0 |1 |0 |0 |1 |3 |1 -69 |0 |1 |0 |0 |1 |3 |1 -70 |0 |1 |0 |0 |1 |3 |1 -71 |0 |1 |0 |0 |1 |3 |1 -72 |0 |1 |0 |0 |1 |3 |1 -73 |0 |1 |0 |0 |1 |3 |1 -74 |0 |1 |0 |0 |1 |3 |1 -75 |0 |1 |0 |0 |1 |3 |1 -76 |0 |1 |0 |0 |1 |3 |1 -77 |0 |1 |0 |0 |1 |3 |1 -78 |0 |1 |0 |0 |1 |3 |1 -79 |0 |1 |0 |0 |1 |3 |1 -80 |0 |1 |0 |0 |1 |3 |1 -81 |0 |1 |0 |0 |1 |3 |1 -82 |0 |1 |0 |0 |1 |3 |1 -83 |0 |1 |0 |0 |1 |3 |1 -84 |0 |1 |0 |0 |1 |3 |1 -85 |0 |1 |0 |0 |1 |3 |1 -86 |0 |1 |0 |0 |1 |3 |1 -87 |0 |1 |0 |0 |1 |3 |1 -88 |0 |1 |0 |0 |1 |3 |1 -89 |0 |1 |0 |0 |1 |3 |1 -90 |0 |1 |0 |0 |1 |3 |1 -91 |0 |1 |0 |0 |1 |3 |1 -92 |0 |1 |0 |0 |1 |3 |1 -93 |0 |1 |0 |0 |1 |3 |1 -94 |0 |1 |0 |0 |1 |3 |1 -95 |0 |1 |0 |0 |1 |3 |1 -96 |0 |1 |0 |0 |1 |3 |1 -97 |0 |1 |0 |0 |1 |3 |1 -98 |0 |1 |0 |0 |1 |3 |1 -99 |0 |1 |0 |0 |1 |3 |1 -100 |0 |1 |0 |0 |1 |3 |1 -101 |0 |1 |0 |0 |1 |3 |1 -102 |0 |1 |0 |0 |1 |3 |1 -103 |0 |1 |0 |0 |1 |3 |1 -104 |0 |1 |0 |0 |1 |3 |1 -105 |0 |1 |0 |0 |1 |3 |1 -106 |0 |1 |0 |0 |1 |3 |1 -107 |0 |1 |0 |0 |1 |3 |1 -108 |0 |1 |0 |0 |1 |3 |1 -109 |0 |1 |0 |0 |1 |3 |1 -110 |0 |1 |0 |0 |1 |3 |1 -111 |0 |1 |0 |0 |1 |3 |1 -112 |0 |1 |0 |0 |1 |3 |1 -113 |0 |1 |0 |0 |1 |3 |1 -114 |0 |1 |0 |0 |1 |3 |1 -115 |0 |1 |0 |0 |1 |3 |1 -116 |0 |1 |0 |0 |1 |3 |1 -117 |0 |1 |0 |0 |1 |3 |1 -118 |0 |1 |0 |0 |1 |3 |1 -119 |0 |1 |0 |0 |1 |3 |1 -120 |0 |1 |0 |0 |1 |3 |1 -121 |0 |1 |0 |0 |1 |3 |1 -122 |0 |1 |0 |0 |1 |3 |1 -123 |0 |1 |0 |0 |1 |3 |1 -124 |0 |1 |0 |0 |1 |3 |1 -125 |0 |1 |0 |0 |1 |3 |1 -126 |0 |1 |0 |0 |1 |3 |1 -127 |0 |1 |0 |0 |1 |3 |1 +SELECT * FROM gp_toolkit.__gp_aoseg_name('ao') ORDER BY segno; +segno|eof|tupcount|varblockcount|eof_uncompressed|modcount|formatversion|state +-----+---+--------+-------------+----------------+--------+-------------+----- +1 |0 |1 |0 |0 |1 |3 |1 +2 |0 |1 |0 |0 |1 |3 |1 +3 |0 |1 |0 |0 |1 |3 |1 +4 |0 |1 |0 |0 |1 |3 |1 +5 |0 |1 |0 |0 |1 |3 |1 +6 |0 |1 |0 |0 |1 |3 |1 +7 |0 |1 |0 |0 |1 |3 |1 +8 |0 |1 |0 |0 |1 |3 |1 +9 |0 |1 |0 |0 |1 |3 |1 +10 |0 |1 |0 |0 |1 |3 |1 +11 |0 |1 |0 |0 |1 |3 |1 +12 |0 |1 |0 |0 |1 |3 |1 +13 |0 |1 |0 |0 |1 |3 |1 +14 |0 |1 |0 |0 |1 |3 |1 +15 |0 |1 |0 |0 |1 |3 |1 +16 |0 |1 |0 |0 |1 |3 |1 +17 |0 |1 |0 |0 |1 |3 |1 +18 |0 |1 |0 |0 |1 |3 |1 +19 |0 |1 |0 |0 |1 |3 |1 +20 |0 |1 |0 |0 |1 |3 |1 +21 |0 |1 |0 |0 |1 |3 |1 +22 |0 |1 |0 |0 |1 |3 |1 +23 |0 |1 |0 |0 |1 |3 |1 +24 |0 |1 |0 |0 |1 |3 |1 +25 |0 |1 |0 |0 |1 |3 |1 +26 |0 |1 |0 |0 |1 |3 |1 +27 |0 |1 |0 |0 |1 |3 |1 +28 |0 |1 |0 |0 |1 |3 |1 +29 |0 |1 |0 |0 |1 |3 |1 +30 |0 |1 |0 |0 |1 |3 |1 +31 |0 |1 |0 |0 |1 |3 |1 +32 |0 |1 |0 |0 |1 |3 |1 +33 |0 |1 |0 |0 |1 |3 |1 +34 |0 |1 |0 |0 |1 |3 |1 +35 |0 |1 |0 |0 |1 |3 |1 +36 |0 |1 |0 |0 |1 |3 |1 +37 |0 |1 |0 |0 |1 |3 |1 +38 |0 |1 |0 |0 |1 |3 |1 +39 |0 |1 |0 |0 |1 |3 |1 +40 |0 |1 |0 |0 |1 |3 |1 +41 |0 |1 |0 |0 |1 |3 |1 +42 |0 |1 |0 |0 |1 |3 |1 +43 |0 |1 |0 |0 |1 |3 |1 +44 |0 |1 |0 |0 |1 |3 |1 +45 |0 |1 |0 |0 |1 |3 |1 +46 |0 |1 |0 |0 |1 |3 |1 +47 |0 |1 |0 |0 |1 |3 |1 +48 |0 |1 |0 |0 |1 |3 |1 +49 |0 |1 |0 |0 |1 |3 |1 +50 |0 |1 |0 |0 |1 |3 |1 +51 |0 |1 |0 |0 |1 |3 |1 +52 |0 |1 |0 |0 |1 |3 |1 +53 |0 |1 |0 |0 |1 |3 |1 +54 |0 |1 |0 |0 |1 |3 |1 +55 |0 |1 |0 |0 |1 |3 |1 +56 |0 |1 |0 |0 |1 |3 |1 +57 |0 |1 |0 |0 |1 |3 |1 +58 |0 |1 |0 |0 |1 |3 |1 +59 |0 |1 |0 |0 |1 |3 |1 +60 |0 |1 |0 |0 |1 |3 |1 +61 |0 |1 |0 |0 |1 |3 |1 +62 |0 |1 |0 |0 |1 |3 |1 +63 |0 |1 |0 |0 |1 |3 |1 +64 |0 |1 |0 |0 |1 |3 |1 +65 |0 |1 |0 |0 |1 |3 |1 +66 |0 |1 |0 |0 |1 |3 |1 +67 |0 |1 |0 |0 |1 |3 |1 +68 |0 |1 |0 |0 |1 |3 |1 +69 |0 |1 |0 |0 |1 |3 |1 +70 |0 |1 |0 |0 |1 |3 |1 +71 |0 |1 |0 |0 |1 |3 |1 +72 |0 |1 |0 |0 |1 |3 |1 +73 |0 |1 |0 |0 |1 |3 |1 +74 |0 |1 |0 |0 |1 |3 |1 +75 |0 |1 |0 |0 |1 |3 |1 +76 |0 |1 |0 |0 |1 |3 |1 +77 |0 |1 |0 |0 |1 |3 |1 +78 |0 |1 |0 |0 |1 |3 |1 +79 |0 |1 |0 |0 |1 |3 |1 +80 |0 |1 |0 |0 |1 |3 |1 +81 |0 |1 |0 |0 |1 |3 |1 +82 |0 |1 |0 |0 |1 |3 |1 +83 |0 |1 |0 |0 |1 |3 |1 +84 |0 |1 |0 |0 |1 |3 |1 +85 |0 |1 |0 |0 |1 |3 |1 +86 |0 |1 |0 |0 |1 |3 |1 +87 |0 |1 |0 |0 |1 |3 |1 +88 |0 |1 |0 |0 |1 |3 |1 +89 |0 |1 |0 |0 |1 |3 |1 +90 |0 |1 |0 |0 |1 |3 |1 +91 |0 |1 |0 |0 |1 |3 |1 +92 |0 |1 |0 |0 |1 |3 |1 +93 |0 |1 |0 |0 |1 |3 |1 +94 |0 |1 |0 |0 |1 |3 |1 +95 |0 |1 |0 |0 |1 |3 |1 +96 |0 |1 |0 |0 |1 |3 |1 +97 |0 |1 |0 |0 |1 |3 |1 +98 |0 |1 |0 |0 |1 |3 |1 +99 |0 |1 |0 |0 |1 |3 |1 +100 |0 |1 |0 |0 |1 |3 |1 +101 |0 |1 |0 |0 |1 |3 |1 +102 |0 |1 |0 |0 |1 |3 |1 +103 |0 |1 |0 |0 |1 |3 |1 +104 |0 |1 |0 |0 |1 |3 |1 +105 |0 |1 |0 |0 |1 |3 |1 +106 |0 |1 |0 |0 |1 |3 |1 +107 |0 |1 |0 |0 |1 |3 |1 +108 |0 |1 |0 |0 |1 |3 |1 +109 |0 |1 |0 |0 |1 |3 |1 +110 |0 |1 |0 |0 |1 |3 |1 +111 |0 |1 |0 |0 |1 |3 |1 +112 |0 |1 |0 |0 |1 |3 |1 +113 |0 |1 |0 |0 |1 |3 |1 +114 |0 |1 |0 |0 |1 |3 |1 +115 |0 |1 |0 |0 |1 |3 |1 +116 |0 |1 |0 |0 |1 |3 |1 +117 |0 |1 |0 |0 |1 |3 |1 +118 |0 |1 |0 |0 |1 |3 |1 +119 |0 |1 |0 |0 |1 |3 |1 +120 |0 |1 |0 |0 |1 |3 |1 +121 |0 |1 |0 |0 |1 |3 |1 +122 |0 |1 |0 |0 |1 |3 |1 +123 |0 |1 |0 |0 |1 |3 |1 +124 |0 |1 |0 |0 |1 |3 |1 +125 |0 |1 |0 |0 |1 |3 |1 +126 |0 |1 |0 |0 |1 |3 |1 +127 |0 |1 |0 |0 |1 |3 |1 (127 rows) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/max_concurrency2.ans b/src/test/isolation2/expected/max_concurrency2.out similarity index 50% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/max_concurrency2.ans rename to src/test/isolation2/expected/max_concurrency2.out index fa478b15e0..bd10ee98fa 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/max_concurrency2.ans +++ b/src/test/isolation2/expected/max_concurrency2.out @@ -1,6 +1,17 @@ -- @Description Insert into a ao relation with 128 concurrent transactions. -- The 128th transaction is expected to fail. --- +-- +-- +-- start_matchsubs +-- m/could not find segment file to use for inserting into relation ao .*/ +-- s/could not find segment file to use for inserting into relation ao .*/could not find segment file to use for inserting into relation ao ###/ +-- end_matchsubs +GP_IGNORE: defined new match expression + +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE 1: BEGIN; BEGIN @@ -513,7 +524,7 @@ INSERT 1 127: INSERT INTO AO VALUES (1, 1); INSERT 1 128: INSERT INTO AO VALUES (1, 1); -ERROR: could not find segment file to use for inserting into relation ao (****). (****) +ERROR: could not find segment file to use for inserting into relation ao ### 1: COMMIT; COMMIT 2: COMMIT; @@ -901,134 +912,134 @@ a|b 1|1 1|1 (127 rows) -SELECT * FROM gp_aoseg_name('ao') ORDER BY segno; -segno|eof|tupcount|varblockcount|eofuncompressed|modcount|formatversion|state ------+---+--------+-------------+---------------+--------+-------------+----- -1 |0 |1 |0 |0 |1 |3 |1 -2 |0 |1 |0 |0 |1 |3 |1 -3 |0 |1 |0 |0 |1 |3 |1 -4 |0 |1 |0 |0 |1 |3 |1 -5 |0 |1 |0 |0 |1 |3 |1 -6 |0 |1 |0 |0 |1 |3 |1 -7 |0 |1 |0 |0 |1 |3 |1 -8 |0 |1 |0 |0 |1 |3 |1 -9 |0 |1 |0 |0 |1 |3 |1 -10 |0 |1 |0 |0 |1 |3 |1 -11 |0 |1 |0 |0 |1 |3 |1 -12 |0 |1 |0 |0 |1 |3 |1 -13 |0 |1 |0 |0 |1 |3 |1 -14 |0 |1 |0 |0 |1 |3 |1 -15 |0 |1 |0 |0 |1 |3 |1 -16 |0 |1 |0 |0 |1 |3 |1 -17 |0 |1 |0 |0 |1 |3 |1 -18 |0 |1 |0 |0 |1 |3 |1 -19 |0 |1 |0 |0 |1 |3 |1 -20 |0 |1 |0 |0 |1 |3 |1 -21 |0 |1 |0 |0 |1 |3 |1 -22 |0 |1 |0 |0 |1 |3 |1 -23 |0 |1 |0 |0 |1 |3 |1 -24 |0 |1 |0 |0 |1 |3 |1 -25 |0 |1 |0 |0 |1 |3 |1 -26 |0 |1 |0 |0 |1 |3 |1 -27 |0 |1 |0 |0 |1 |3 |1 -28 |0 |1 |0 |0 |1 |3 |1 -29 |0 |1 |0 |0 |1 |3 |1 -30 |0 |1 |0 |0 |1 |3 |1 -31 |0 |1 |0 |0 |1 |3 |1 -32 |0 |1 |0 |0 |1 |3 |1 -33 |0 |1 |0 |0 |1 |3 |1 -34 |0 |1 |0 |0 |1 |3 |1 -35 |0 |1 |0 |0 |1 |3 |1 -36 |0 |1 |0 |0 |1 |3 |1 -37 |0 |1 |0 |0 |1 |3 |1 -38 |0 |1 |0 |0 |1 |3 |1 -39 |0 |1 |0 |0 |1 |3 |1 -40 |0 |1 |0 |0 |1 |3 |1 -41 |0 |1 |0 |0 |1 |3 |1 -42 |0 |1 |0 |0 |1 |3 |1 -43 |0 |1 |0 |0 |1 |3 |1 -44 |0 |1 |0 |0 |1 |3 |1 -45 |0 |1 |0 |0 |1 |3 |1 -46 |0 |1 |0 |0 |1 |3 |1 -47 |0 |1 |0 |0 |1 |3 |1 -48 |0 |1 |0 |0 |1 |3 |1 -49 |0 |1 |0 |0 |1 |3 |1 -50 |0 |1 |0 |0 |1 |3 |1 -51 |0 |1 |0 |0 |1 |3 |1 -52 |0 |1 |0 |0 |1 |3 |1 -53 |0 |1 |0 |0 |1 |3 |1 -54 |0 |1 |0 |0 |1 |3 |1 -55 |0 |1 |0 |0 |1 |3 |1 -56 |0 |1 |0 |0 |1 |3 |1 -57 |0 |1 |0 |0 |1 |3 |1 -58 |0 |1 |0 |0 |1 |3 |1 -59 |0 |1 |0 |0 |1 |3 |1 -60 |0 |1 |0 |0 |1 |3 |1 -61 |0 |1 |0 |0 |1 |3 |1 -62 |0 |1 |0 |0 |1 |3 |1 -63 |0 |1 |0 |0 |1 |3 |1 -64 |0 |1 |0 |0 |1 |3 |1 -65 |0 |1 |0 |0 |1 |3 |1 -66 |0 |1 |0 |0 |1 |3 |1 -67 |0 |1 |0 |0 |1 |3 |1 -68 |0 |1 |0 |0 |1 |3 |1 -69 |0 |1 |0 |0 |1 |3 |1 -70 |0 |1 |0 |0 |1 |3 |1 -71 |0 |1 |0 |0 |1 |3 |1 -72 |0 |1 |0 |0 |1 |3 |1 -73 |0 |1 |0 |0 |1 |3 |1 -74 |0 |1 |0 |0 |1 |3 |1 -75 |0 |1 |0 |0 |1 |3 |1 -76 |0 |1 |0 |0 |1 |3 |1 -77 |0 |1 |0 |0 |1 |3 |1 -78 |0 |1 |0 |0 |1 |3 |1 -79 |0 |1 |0 |0 |1 |3 |1 -80 |0 |1 |0 |0 |1 |3 |1 -81 |0 |1 |0 |0 |1 |3 |1 -82 |0 |1 |0 |0 |1 |3 |1 -83 |0 |1 |0 |0 |1 |3 |1 -84 |0 |1 |0 |0 |1 |3 |1 -85 |0 |1 |0 |0 |1 |3 |1 -86 |0 |1 |0 |0 |1 |3 |1 -87 |0 |1 |0 |0 |1 |3 |1 -88 |0 |1 |0 |0 |1 |3 |1 -89 |0 |1 |0 |0 |1 |3 |1 -90 |0 |1 |0 |0 |1 |3 |1 -91 |0 |1 |0 |0 |1 |3 |1 -92 |0 |1 |0 |0 |1 |3 |1 -93 |0 |1 |0 |0 |1 |3 |1 -94 |0 |1 |0 |0 |1 |3 |1 -95 |0 |1 |0 |0 |1 |3 |1 -96 |0 |1 |0 |0 |1 |3 |1 -97 |0 |1 |0 |0 |1 |3 |1 -98 |0 |1 |0 |0 |1 |3 |1 -99 |0 |1 |0 |0 |1 |3 |1 -100 |0 |1 |0 |0 |1 |3 |1 -101 |0 |1 |0 |0 |1 |3 |1 -102 |0 |1 |0 |0 |1 |3 |1 -103 |0 |1 |0 |0 |1 |3 |1 -104 |0 |1 |0 |0 |1 |3 |1 -105 |0 |1 |0 |0 |1 |3 |1 -106 |0 |1 |0 |0 |1 |3 |1 -107 |0 |1 |0 |0 |1 |3 |1 -108 |0 |1 |0 |0 |1 |3 |1 -109 |0 |1 |0 |0 |1 |3 |1 -110 |0 |1 |0 |0 |1 |3 |1 -111 |0 |1 |0 |0 |1 |3 |1 -112 |0 |1 |0 |0 |1 |3 |1 -113 |0 |1 |0 |0 |1 |3 |1 -114 |0 |1 |0 |0 |1 |3 |1 -115 |0 |1 |0 |0 |1 |3 |1 -116 |0 |1 |0 |0 |1 |3 |1 -117 |0 |1 |0 |0 |1 |3 |1 -118 |0 |1 |0 |0 |1 |3 |1 -119 |0 |1 |0 |0 |1 |3 |1 -120 |0 |1 |0 |0 |1 |3 |1 -121 |0 |1 |0 |0 |1 |3 |1 -122 |0 |1 |0 |0 |1 |3 |1 -123 |0 |1 |0 |0 |1 |3 |1 -124 |0 |1 |0 |0 |1 |3 |1 -125 |0 |1 |0 |0 |1 |3 |1 -126 |0 |1 |0 |0 |1 |3 |1 -127 |0 |1 |0 |0 |1 |3 |1 +SELECT * FROM gp_toolkit.__gp_aoseg_name('ao') ORDER BY segno; +segno|eof|tupcount|varblockcount|eof_uncompressed|modcount|formatversion|state +-----+---+--------+-------------+----------------+--------+-------------+----- +1 |0 |1 |0 |0 |1 |3 |1 +2 |0 |1 |0 |0 |1 |3 |1 +3 |0 |1 |0 |0 |1 |3 |1 +4 |0 |1 |0 |0 |1 |3 |1 +5 |0 |1 |0 |0 |1 |3 |1 +6 |0 |1 |0 |0 |1 |3 |1 +7 |0 |1 |0 |0 |1 |3 |1 +8 |0 |1 |0 |0 |1 |3 |1 +9 |0 |1 |0 |0 |1 |3 |1 +10 |0 |1 |0 |0 |1 |3 |1 +11 |0 |1 |0 |0 |1 |3 |1 +12 |0 |1 |0 |0 |1 |3 |1 +13 |0 |1 |0 |0 |1 |3 |1 +14 |0 |1 |0 |0 |1 |3 |1 +15 |0 |1 |0 |0 |1 |3 |1 +16 |0 |1 |0 |0 |1 |3 |1 +17 |0 |1 |0 |0 |1 |3 |1 +18 |0 |1 |0 |0 |1 |3 |1 +19 |0 |1 |0 |0 |1 |3 |1 +20 |0 |1 |0 |0 |1 |3 |1 +21 |0 |1 |0 |0 |1 |3 |1 +22 |0 |1 |0 |0 |1 |3 |1 +23 |0 |1 |0 |0 |1 |3 |1 +24 |0 |1 |0 |0 |1 |3 |1 +25 |0 |1 |0 |0 |1 |3 |1 +26 |0 |1 |0 |0 |1 |3 |1 +27 |0 |1 |0 |0 |1 |3 |1 +28 |0 |1 |0 |0 |1 |3 |1 +29 |0 |1 |0 |0 |1 |3 |1 +30 |0 |1 |0 |0 |1 |3 |1 +31 |0 |1 |0 |0 |1 |3 |1 +32 |0 |1 |0 |0 |1 |3 |1 +33 |0 |1 |0 |0 |1 |3 |1 +34 |0 |1 |0 |0 |1 |3 |1 +35 |0 |1 |0 |0 |1 |3 |1 +36 |0 |1 |0 |0 |1 |3 |1 +37 |0 |1 |0 |0 |1 |3 |1 +38 |0 |1 |0 |0 |1 |3 |1 +39 |0 |1 |0 |0 |1 |3 |1 +40 |0 |1 |0 |0 |1 |3 |1 +41 |0 |1 |0 |0 |1 |3 |1 +42 |0 |1 |0 |0 |1 |3 |1 +43 |0 |1 |0 |0 |1 |3 |1 +44 |0 |1 |0 |0 |1 |3 |1 +45 |0 |1 |0 |0 |1 |3 |1 +46 |0 |1 |0 |0 |1 |3 |1 +47 |0 |1 |0 |0 |1 |3 |1 +48 |0 |1 |0 |0 |1 |3 |1 +49 |0 |1 |0 |0 |1 |3 |1 +50 |0 |1 |0 |0 |1 |3 |1 +51 |0 |1 |0 |0 |1 |3 |1 +52 |0 |1 |0 |0 |1 |3 |1 +53 |0 |1 |0 |0 |1 |3 |1 +54 |0 |1 |0 |0 |1 |3 |1 +55 |0 |1 |0 |0 |1 |3 |1 +56 |0 |1 |0 |0 |1 |3 |1 +57 |0 |1 |0 |0 |1 |3 |1 +58 |0 |1 |0 |0 |1 |3 |1 +59 |0 |1 |0 |0 |1 |3 |1 +60 |0 |1 |0 |0 |1 |3 |1 +61 |0 |1 |0 |0 |1 |3 |1 +62 |0 |1 |0 |0 |1 |3 |1 +63 |0 |1 |0 |0 |1 |3 |1 +64 |0 |1 |0 |0 |1 |3 |1 +65 |0 |1 |0 |0 |1 |3 |1 +66 |0 |1 |0 |0 |1 |3 |1 +67 |0 |1 |0 |0 |1 |3 |1 +68 |0 |1 |0 |0 |1 |3 |1 +69 |0 |1 |0 |0 |1 |3 |1 +70 |0 |1 |0 |0 |1 |3 |1 +71 |0 |1 |0 |0 |1 |3 |1 +72 |0 |1 |0 |0 |1 |3 |1 +73 |0 |1 |0 |0 |1 |3 |1 +74 |0 |1 |0 |0 |1 |3 |1 +75 |0 |1 |0 |0 |1 |3 |1 +76 |0 |1 |0 |0 |1 |3 |1 +77 |0 |1 |0 |0 |1 |3 |1 +78 |0 |1 |0 |0 |1 |3 |1 +79 |0 |1 |0 |0 |1 |3 |1 +80 |0 |1 |0 |0 |1 |3 |1 +81 |0 |1 |0 |0 |1 |3 |1 +82 |0 |1 |0 |0 |1 |3 |1 +83 |0 |1 |0 |0 |1 |3 |1 +84 |0 |1 |0 |0 |1 |3 |1 +85 |0 |1 |0 |0 |1 |3 |1 +86 |0 |1 |0 |0 |1 |3 |1 +87 |0 |1 |0 |0 |1 |3 |1 +88 |0 |1 |0 |0 |1 |3 |1 +89 |0 |1 |0 |0 |1 |3 |1 +90 |0 |1 |0 |0 |1 |3 |1 +91 |0 |1 |0 |0 |1 |3 |1 +92 |0 |1 |0 |0 |1 |3 |1 +93 |0 |1 |0 |0 |1 |3 |1 +94 |0 |1 |0 |0 |1 |3 |1 +95 |0 |1 |0 |0 |1 |3 |1 +96 |0 |1 |0 |0 |1 |3 |1 +97 |0 |1 |0 |0 |1 |3 |1 +98 |0 |1 |0 |0 |1 |3 |1 +99 |0 |1 |0 |0 |1 |3 |1 +100 |0 |1 |0 |0 |1 |3 |1 +101 |0 |1 |0 |0 |1 |3 |1 +102 |0 |1 |0 |0 |1 |3 |1 +103 |0 |1 |0 |0 |1 |3 |1 +104 |0 |1 |0 |0 |1 |3 |1 +105 |0 |1 |0 |0 |1 |3 |1 +106 |0 |1 |0 |0 |1 |3 |1 +107 |0 |1 |0 |0 |1 |3 |1 +108 |0 |1 |0 |0 |1 |3 |1 +109 |0 |1 |0 |0 |1 |3 |1 +110 |0 |1 |0 |0 |1 |3 |1 +111 |0 |1 |0 |0 |1 |3 |1 +112 |0 |1 |0 |0 |1 |3 |1 +113 |0 |1 |0 |0 |1 |3 |1 +114 |0 |1 |0 |0 |1 |3 |1 +115 |0 |1 |0 |0 |1 |3 |1 +116 |0 |1 |0 |0 |1 |3 |1 +117 |0 |1 |0 |0 |1 |3 |1 +118 |0 |1 |0 |0 |1 |3 |1 +119 |0 |1 |0 |0 |1 |3 |1 +120 |0 |1 |0 |0 |1 |3 |1 +121 |0 |1 |0 |0 |1 |3 |1 +122 |0 |1 |0 |0 |1 |3 |1 +123 |0 |1 |0 |0 |1 |3 |1 +124 |0 |1 |0 |0 |1 |3 |1 +125 |0 |1 |0 |0 |1 |3 |1 +126 |0 |1 |0 |0 |1 |3 |1 +127 |0 |1 |0 |0 |1 |3 |1 (127 rows) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/modcount.ans b/src/test/isolation2/expected/modcount.out similarity index 51% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/modcount.ans rename to src/test/isolation2/expected/modcount.out index 657ac138e6..a579e841a0 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/modcount.ans +++ b/src/test/isolation2/expected/modcount.out @@ -1,28 +1,34 @@ -- @Description Tests that DML operatins change the modification count. --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; +INSERT 10 -SELECT state, tupcount, modcount FROM gp_aoseg_name('ao'); +SELECT state, tupcount, modcount FROM gp_toolkit.__gp_aoseg_name('ao'); state|tupcount|modcount -----+--------+-------- 1 |10 |1 (1 row) INSERT INTO ao VALUES (11, 11); INSERT 1 -SELECT state, tupcount, modcount FROM gp_aoseg_name('ao'); +SELECT state, tupcount, modcount FROM gp_toolkit.__gp_aoseg_name('ao'); state|tupcount|modcount -----+--------+-------- 1 |11 |2 (1 row) DELETE FROM ao WHERE a = 11; DELETE 1 -SELECT state, tupcount, modcount FROM gp_aoseg_name('ao'); +SELECT state, tupcount, modcount FROM gp_toolkit.__gp_aoseg_name('ao'); state|tupcount|modcount -----+--------+-------- 1 |11 |3 (1 row) UPDATE AO SET b = 0 WHERE a = 10; UPDATE 1 -SELECT state, tupcount, modcount FROM gp_aoseg_name('ao'); +SELECT state, tupcount, modcount FROM gp_toolkit.__gp_aoseg_name('ao'); state|tupcount|modcount -----+--------+-------- 1 |12 |4 diff --git a/src/test/isolation2/expected/modcount_vacuum.out b/src/test/isolation2/expected/modcount_vacuum.out new file mode 100644 index 0000000000..668dbd3f5e --- /dev/null +++ b/src/test/isolation2/expected/modcount_vacuum.out @@ -0,0 +1,24 @@ +-- @Description Tests that vacuum is not changing the modification count. +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; +INSERT 10 + +DELETE FROM ao WHERE a < 5; +DELETE 4 +SELECT state, tupcount, modcount FROM gp_toolkit.__gp_aoseg_name('ao'); +state|tupcount|modcount +-----+--------+-------- +1 |10 |2 +(1 row) +VACUUM ao; +VACUUM +SELECT state, tupcount, modcount FROM gp_toolkit.__gp_aoseg_name('ao'); +state|tupcount|modcount +-----+--------+-------- +1 |0 |2 +1 |6 |0 +(2 rows) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_delete.ans b/src/test/isolation2/expected/parallel_delete.out similarity index 52% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_delete.ans rename to src/test/isolation2/expected/parallel_delete.out index 70db53df95..69dfd3cac3 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_delete.ans +++ b/src/test/isolation2/expected/parallel_delete.out @@ -1,7 +1,19 @@ -- @Description Tests that a delete operation in progress will block all other deletes -- until the transaction is committed. --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true) DISTRIBUTED BY (a); +CREATE +insert into ao select generate_series(1,100); +INSERT 100 +DROP VIEW IF EXISTS locktest; +DROP +create view locktest as select coalesce( case when relname like 'pg_toast%index' then 'toast index' when relname like 'pg_toast%' then 'toast table' else relname end, 'dropped table'), mode, locktype from pg_locks l left outer join pg_class c on (l.relation = c.oid), pg_database d where relation is not null and l.database = d.oid and l.gp_segment_id = -1 and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; +CREATE + +-- The actual test begins 1: BEGIN; BEGIN 2: BEGIN; @@ -31,7 +43,7 @@ a (2 rows) 3: COMMIT; COMMIT -2U: SELECT * FROM gp_aovisimap_name('ao'); +2U: SELECT * FROM gp_toolkit.__gp_aovisimap_name('ao'); tid |segno|row_num ----------------+-----+------- (33554432,32769)|1 |1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_delete_2seg.ans b/src/test/isolation2/expected/parallel_delete_2.out similarity index 51% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_delete_2seg.ans rename to src/test/isolation2/expected/parallel_delete_2.out index e67fae1ddc..1ad1124c1c 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_delete_2seg.ans +++ b/src/test/isolation2/expected/parallel_delete_2.out @@ -1,7 +1,19 @@ -- @Description Tests that a delete operation in progress will block all other deletes -- until the transaction is committed. -- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true) DISTRIBUTED BY (a); +CREATE +insert into ao select generate_series(1,100); +INSERT 100 +DROP VIEW IF EXISTS locktest; +DROP +create view locktest as select coalesce( case when relname like 'pg_toast%index' then 'toast index' when relname like 'pg_toast%' then 'toast table' else relname end, 'dropped table'), mode, locktype from pg_locks l left outer join pg_class c on (l.relation = c.oid), pg_database d where relation is not null and l.database = d.oid and l.gp_segment_id = -1 and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; +CREATE + +-- The actual test begins 1: BEGIN; BEGIN 2: BEGIN; @@ -31,7 +43,7 @@ a (2 rows) 3: COMMIT; COMMIT -2U: SELECT * FROM gp_aovisimap_name('ao'); +2U: SELECT * FROM gp_toolkit.__gp_aovisimap_name('ao'); tid |segno|row_num ----------------+-----+------- (33554432,32769)|1 |1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_update.ans b/src/test/isolation2/expected/parallel_update.out similarity index 52% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_update.ans rename to src/test/isolation2/expected/parallel_update.out index 0dab15a3d7..9c8d9575fc 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_update.ans +++ b/src/test/isolation2/expected/parallel_update.out @@ -1,7 +1,19 @@ -- @Description Tests that a update operation in progress will block all other updates -- until the transaction is committed. --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; +INSERT 10 +DROP VIEW IF EXISTS locktest; +DROP +create view locktest as select coalesce( case when relname like 'pg_toast%index' then 'toast index' when relname like 'pg_toast%' then 'toast table' else relname end, 'dropped table'), mode, locktype from pg_locks l left outer join pg_class c on (l.relation = c.oid), pg_database d where relation is not null and l.database = d.oid and l.gp_segment_id = -1 and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; +CREATE + +-- The actual test begins 1: BEGIN; BEGIN 2: BEGIN; @@ -29,7 +41,7 @@ a|b 3|3 4|4 (4 rows) -2U: SELECT * FROM gp_aovisimap_name('ao'); +2U: SELECT * FROM gp_toolkit.__gp_aovisimap_name('ao'); tid |segno|row_num ----------------+-----+------- (33554432,32769)|1 |1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_update_2seg.ans b/src/test/isolation2/expected/parallel_update_2.out similarity index 51% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_update_2seg.ans rename to src/test/isolation2/expected/parallel_update_2.out index 1c5f4a45a7..ccde20f4ee 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_update_2seg.ans +++ b/src/test/isolation2/expected/parallel_update_2.out @@ -1,7 +1,19 @@ -- @Description Tests that a update operation in progress will block all other updates -- until the transaction is committed. -- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; +INSERT 10 +DROP VIEW IF EXISTS locktest; +DROP +create view locktest as select coalesce( case when relname like 'pg_toast%index' then 'toast index' when relname like 'pg_toast%' then 'toast table' else relname end, 'dropped table'), mode, locktype from pg_locks l left outer join pg_class c on (l.relation = c.oid), pg_database d where relation is not null and l.database = d.oid and l.gp_segment_id = -1 and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; +CREATE + +-- The actual test begins 1: BEGIN; BEGIN 2: BEGIN; @@ -29,9 +41,8 @@ a|b 3|3 4|4 (4 rows) -2U: SELECT * FROM gp_aovisimap_name('ao'); +2U: SELECT * FROM gp_toolkit.__gp_aovisimap_name('ao'); tid |segno|row_num ----------------+-----+------- (33554432,32769)|1 |1 (1 row) - diff --git a/src/test/isolation2/expected/parallel_update_readcommitted.out b/src/test/isolation2/expected/parallel_update_readcommitted.out new file mode 100644 index 0000000000..f38adf8181 --- /dev/null +++ b/src/test/isolation2/expected/parallel_update_readcommitted.out @@ -0,0 +1,33 @@ +-- @Description Tests that a update operation in progress will block all other updates +-- until the transaction is committed. +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; +INSERT 10 + +DROP VIEW IF EXISTS locktest; +DROP +create view locktest as select coalesce( case when relname like 'pg_toast%index' then 'toast index' when relname like 'pg_toast%' then 'toast table' else relname end, 'dropped table'), mode, locktype from pg_locks l left outer join pg_class c on (l.relation = c.oid), pg_database d where relation is not null and l.database = d.oid and l.gp_segment_id = -1 and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; +CREATE + +-- The actual test begins +1: BEGIN; +BEGIN +2: BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED; +BEGIN +1: UPDATE ao SET b = 42 WHERE b = 1; +UPDATE 1 +2&: UPDATE ao SET b = -1 WHERE b = 1; +1: COMMIT; +COMMIT +2<: <... completed> +UPDATE 0 +2: COMMIT; +COMMIT +SELECT * FROM ao WHERE b < 2; +a|b +-+- +(0 rows) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads.ans b/src/test/isolation2/expected/phantom_reads.out similarity index 74% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads.ans rename to src/test/isolation2/expected/phantom_reads.out index 065adcdcc1..a8dc31a370 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads.ans +++ b/src/test/isolation2/expected/phantom_reads.out @@ -1,6 +1,12 @@ -- @Description Tests the basic phantom read behavior of GPDB. -- Actually, no UAO is involved here. --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; +INSERT 100 1: BEGIN; BEGIN diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_delete.ans b/src/test/isolation2/expected/phantom_reads_delete.out similarity index 74% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_delete.ans rename to src/test/isolation2/expected/phantom_reads_delete.out index ee724c6579..a8684b9291 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_delete.ans +++ b/src/test/isolation2/expected/phantom_reads_delete.out @@ -1,6 +1,12 @@ -- @Description Tests the basic phantom read behavior of GPDB w.r.t to delete using -- the default isolation level. --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; +INSERT 100 1: BEGIN; BEGIN diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_delete_serializable.ans b/src/test/isolation2/expected/phantom_reads_delete_serializable.out similarity index 100% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_delete_serializable.ans rename to src/test/isolation2/expected/phantom_reads_delete_serializable.out diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_serializable.ans b/src/test/isolation2/expected/phantom_reads_serializable.out similarity index 76% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_serializable.ans rename to src/test/isolation2/expected/phantom_reads_serializable.out index 517441ad30..c4a9dc4feb 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_serializable.ans +++ b/src/test/isolation2/expected/phantom_reads_serializable.out @@ -1,6 +1,12 @@ -- @Description Tests the basic phantom read behavior of GPDB with serializable. -- transactions. Actually, no UAO is involved here. --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; +INSERT 100 1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; BEGIN diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_update.ans b/src/test/isolation2/expected/phantom_reads_update.out similarity index 74% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_update.ans rename to src/test/isolation2/expected/phantom_reads_update.out index b917bcccb4..0974f733ed 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_update.ans +++ b/src/test/isolation2/expected/phantom_reads_update.out @@ -1,6 +1,12 @@ -- @Description Tests the basic phantom read behavior of GPDB w.r.t to updates using -- the default isolation level. --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; +INSERT 100 1: BEGIN; BEGIN diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_update_serializable.ans b/src/test/isolation2/expected/phantom_reads_update_serializable.out similarity index 100% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/phantom_reads_update_serializable.ans rename to src/test/isolation2/expected/phantom_reads_update_serializable.out diff --git a/src/test/isolation2/expected/select_after_vacuum.out b/src/test/isolation2/expected/select_after_vacuum.out new file mode 100644 index 0000000000..5228d3e761 --- /dev/null +++ b/src/test/isolation2/expected/select_after_vacuum.out @@ -0,0 +1,102 @@ +-- @Description Ensures that a select after a vacuum operation is ok +-- +DROP TABLE IF EXISTS ao; +DROP +DROP TABLE IF EXISTS ao2; +DROP +CREATE TABLE ao2 (a INT) WITH (appendonly=true); +CREATE +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao2 select generate_series(1,1000); +INSERT 1000 + +DROP VIEW IF EXISTS locktest; +DROP +create view locktest as select coalesce( case when relname like 'pg_toast%index' then 'toast index' when relname like 'pg_toast%' then 'toast table' else relname end, 'dropped table'), mode, locktype from pg_locks l left outer join pg_class c on (l.relation = c.oid), pg_database d where relation is not null and l.database = d.oid and l.gp_segment_id = -1 and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; +CREATE + +-- The actual test begins +DELETE FROM ao WHERE a < 128; +DELETE 2667 +1: BEGIN; +BEGIN +1: SELECT COUNT(*) FROM ao2; +count +----- +1000 +(1 row) +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |21000 +(1 row) +2: VACUUM ao; +VACUUM +1: SELECT COUNT(*) FROM ao; +count +----- +18333 +(1 row) +1: SELECT * FROM locktest WHERE coalesce = 'ao'; +coalesce|mode |locktype +--------+---------------+-------- +ao |AccessShareLock|relation +(1 row) +1: COMMIT; +COMMIT +1: SELECT COUNT(*) FROM ao; +count +----- +18333 +(1 row) +3: INSERT INTO ao VALUES (0); +INSERT 1 +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |1 +2 |18333 +(2 rows) diff --git a/src/test/isolation2/expected/select_after_vacuum_2.out b/src/test/isolation2/expected/select_after_vacuum_2.out new file mode 100644 index 0000000000..adefe7a5c2 --- /dev/null +++ b/src/test/isolation2/expected/select_after_vacuum_2.out @@ -0,0 +1,102 @@ +-- @Description Ensures that a select after a vacuum operation is ok +-- +DROP TABLE IF EXISTS ao; +DROP +DROP TABLE IF EXISTS ao2; +DROP +CREATE TABLE ao2 (a INT) WITH (appendonly=true); +CREATE +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao2 select generate_series(1,1000); +INSERT 1000 + +DROP VIEW IF EXISTS locktest; +DROP +create view locktest as select coalesce( case when relname like 'pg_toast%index' then 'toast index' when relname like 'pg_toast%' then 'toast table' else relname end, 'dropped table'), mode, locktype from pg_locks l left outer join pg_class c on (l.relation = c.oid), pg_database d where relation is not null and l.database = d.oid and l.gp_segment_id = -1 and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; +CREATE + +-- The actual test begins +DELETE FROM ao WHERE a < 128; +DELETE 2667 +1: BEGIN; +BEGIN +1: SELECT COUNT(*) FROM ao2; +count +----- +1000 +(1 row) +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |10521 +(1 row) +2: VACUUM ao; +VACUUM +1: SELECT COUNT(*) FROM ao; +count +----- +18333 +(1 row) +1: SELECT * FROM locktest WHERE coalesce = 'ao'; +coalesce|mode |locktype +--------+---------------+-------- +ao |AccessShareLock|relation +(1 row) +1: COMMIT; +COMMIT +1: SELECT COUNT(*) FROM ao; +count +----- +18333 +(1 row) +3: INSERT INTO ao VALUES (0); +INSERT 1 +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |0 +2 |9177 +(2 rows) diff --git a/src/test/isolation2/expected/select_after_vacuum_serializable.out b/src/test/isolation2/expected/select_after_vacuum_serializable.out new file mode 100644 index 0000000000..bc6abc5a36 --- /dev/null +++ b/src/test/isolation2/expected/select_after_vacuum_serializable.out @@ -0,0 +1,75 @@ +-- @Description Ensures that a serializable select before during a vacuum operation blocks the vacuum. +-- +DROP TABLE IF EXISTS ao; +DROP +DROP TABLE IF EXISTS ao2; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +CREATE TABLE ao2 (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao2 select generate_series(1,1000); +INSERT 1000 + +DELETE FROM ao WHERE a < 128; +DELETE 2667 +1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; +BEGIN +1: SELECT COUNT(*) FROM ao2; +count +----- +1000 +(1 row) +2: VACUUM ao; +VACUUM +1: SELECT COUNT(*) FROM ao; +count +----- +18333 +(1 row) +1: COMMIT; +COMMIT +3: INSERT INTO ao VALUES (0); +INSERT 1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_before_delete.ans b/src/test/isolation2/expected/select_before_delete.out similarity index 100% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_before_delete.ans rename to src/test/isolation2/expected/select_before_delete.out diff --git a/src/test/isolation2/expected/select_before_vacuum.out b/src/test/isolation2/expected/select_before_vacuum.out new file mode 100644 index 0000000000..18614ac6c9 --- /dev/null +++ b/src/test/isolation2/expected/select_before_vacuum.out @@ -0,0 +1,80 @@ +-- @Description Ensures that a select before a vacuum operation is ok +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 + +DROP VIEW IF EXISTS locktest; +DROP +create view locktest as select coalesce( case when relname like 'pg_toast%index' then 'toast index' when relname like 'pg_toast%' then 'toast table' else relname end, 'dropped table'), mode, locktype from pg_locks l left outer join pg_class c on (l.relation = c.oid), pg_database d where relation is not null and l.database = d.oid and l.gp_segment_id = -1 and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; +CREATE + +DELETE FROM ao WHERE a < 128; +DELETE 2667 +1: BEGIN; +BEGIN +1: SELECT COUNT(*) FROM ao; +count +----- +18333 +(1 row) +1: SELECT * FROM locktest WHERE coalesce = 'ao'; +coalesce|mode |locktype +--------+---------------+-------- +ao |AccessShareLock|relation +(1 row) +2&: VACUUM ao; +1: COMMIT; +COMMIT +2<: <... completed> +VACUUM +1: SELECT COUNT(*) FROM ao; +count +----- +18333 +(1 row) +3: INSERT INTO ao VALUES (0); +INSERT 1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_delete.ans b/src/test/isolation2/expected/select_while_delete.out similarity index 78% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_delete.ans rename to src/test/isolation2/expected/select_while_delete.out index 0e99336dba..df0cc8fd4a 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_delete.ans +++ b/src/test/isolation2/expected/select_while_delete.out @@ -1,5 +1,11 @@ -- @Description Ensures that a select during a delete operation is ok --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,100); +INSERT 100 2: BEGIN; BEGIN @@ -45,7 +51,7 @@ a 8 9 (5 rows) -2U: SELECT * FROM gp_aovisimap_name('ao'); +2U: SELECT * FROM gp_toolkit.__gp_aovisimap_name('ao'); tid |segno|row_num ----------------+-----+------- (33554432,32769)|1 |1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_delete_2seg.ans b/src/test/isolation2/expected/select_while_delete_2.out similarity index 76% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_delete_2seg.ans rename to src/test/isolation2/expected/select_while_delete_2.out index 51f1b4af91..410fc53cf1 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_delete_2seg.ans +++ b/src/test/isolation2/expected/select_while_delete_2.out @@ -1,5 +1,11 @@ -- @Description Ensures that a select during a delete operation is ok -- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,100); +INSERT 100 2: BEGIN; BEGIN @@ -45,7 +51,7 @@ a 8 9 (5 rows) -2U: SELECT * FROM gp_aovisimap_name('ao'); +2U: SELECT * FROM gp_toolkit.__gp_aovisimap_name('ao'); tid |segno|row_num ----------------+-----+------- (33554432,32769)|1 |1 @@ -53,4 +59,3 @@ tid |segno|row_num (2 rows) 4: INSERT INTO ao VALUES (0); INSERT 1 - diff --git a/src/test/isolation2/expected/select_while_full_vacuum.out b/src/test/isolation2/expected/select_while_full_vacuum.out new file mode 100644 index 0000000000..9bacba7354 --- /dev/null +++ b/src/test/isolation2/expected/select_while_full_vacuum.out @@ -0,0 +1,60 @@ +-- @Description Ensures that a select during a full vacuum operation is ok +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 + +DELETE FROM ao WHERE a < 128; +DELETE 2667 +1: BEGIN; +BEGIN +1>: SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;COMMIT; +2: VACUUM FULL ao; +VACUUM +1<: <... completed> +SELECT +3: INSERT INTO ao VALUES (0); +INSERT 1 diff --git a/src/test/isolation2/expected/select_while_vacuum.out b/src/test/isolation2/expected/select_while_vacuum.out new file mode 100644 index 0000000000..7837ed872f --- /dev/null +++ b/src/test/isolation2/expected/select_while_vacuum.out @@ -0,0 +1,60 @@ +-- @Description Ensures that a select during a vacuum operation is ok +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 + +DELETE FROM ao WHERE a < 128; +DELETE 2667 +1: BEGIN; +BEGIN +1>: SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;COMMIT;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;COMMIT; +2: VACUUM ao; +VACUUM +1<: <... completed> +SELECT +3: INSERT INTO ao VALUES (0); +INSERT 1 diff --git a/src/test/isolation2/expected/select_while_vacuum_serializable.out b/src/test/isolation2/expected/select_while_vacuum_serializable.out new file mode 100644 index 0000000000..91ce2aeabb --- /dev/null +++ b/src/test/isolation2/expected/select_while_vacuum_serializable.out @@ -0,0 +1,62 @@ +-- @Description Ensures that a select from a serializalbe transaction is ok after vacuum +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 + +DELETE FROM ao WHERE a < 128; +DELETE 2667 +1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; +BEGIN +2: VACUUM ao; +VACUUM +1: SELECT COUNT(*) FROM ao; +count +----- +18333 +(1 row) +3: INSERT INTO ao VALUES (0); +INSERT 1 diff --git a/src/test/isolation2/expected/select_while_vacuum_serializable2.out b/src/test/isolation2/expected/select_while_vacuum_serializable2.out new file mode 100644 index 0000000000..fc4cef63e3 --- /dev/null +++ b/src/test/isolation2/expected/select_while_vacuum_serializable2.out @@ -0,0 +1,79 @@ +-- @Description Ensures that a serializable select before during a vacuum operation avoids the compaction. +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 + +DELETE FROM ao WHERE a < 128; +DELETE 2667 +1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; +BEGIN +1: SELECT COUNT(*) FROM ao; +count +----- +18333 +(1 row) +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |21000 +(1 row) +2: VACUUM ao; +VACUUM +1: SELECT COUNT(*) FROM ao; +count +----- +18333 +(1 row) +1: COMMIT; +COMMIT +3: INSERT INTO ao VALUES (0); +INSERT 1 +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |21001 +(1 row) diff --git a/src/test/isolation2/expected/select_while_vacuum_serializable2_2.out b/src/test/isolation2/expected/select_while_vacuum_serializable2_2.out new file mode 100644 index 0000000000..bbac4a17aa --- /dev/null +++ b/src/test/isolation2/expected/select_while_vacuum_serializable2_2.out @@ -0,0 +1,79 @@ +-- @Description Ensures that a serializable select before during a vacuum operation avoids the compaction. +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 + +DELETE FROM ao WHERE a < 128; +DELETE 2667 +1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; +BEGIN +1: SELECT COUNT(*) FROM ao; +count +----- +18333 +(1 row) +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |10521 +(1 row) +2: VACUUM ao; +VACUUM +1: SELECT COUNT(*) FROM ao; +count +----- +18333 +(1 row) +1: COMMIT; +COMMIT +3: INSERT INTO ao VALUES (0); +INSERT 1 +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +segno|tupcount +-----+-------- +1 |10521 +(1 row) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/selectinsert_while_vacuum.ans b/src/test/isolation2/expected/selectinsert_while_vacuum.out similarity index 53% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/selectinsert_while_vacuum.ans rename to src/test/isolation2/expected/selectinsert_while_vacuum.out index 4a47a7b45a..fc57e83d03 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/selectinsert_while_vacuum.ans +++ b/src/test/isolation2/expected/selectinsert_while_vacuum.out @@ -1,5 +1,51 @@ -- @Description Ensures that an insert during a vacuum operation is ok --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 DELETE FROM ao WHERE a < 128; DELETE 2667 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/selectinsertupdate_while_vacuum.ans b/src/test/isolation2/expected/selectinsertupdate_while_vacuum.out similarity index 72% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/selectinsertupdate_while_vacuum.ans rename to src/test/isolation2/expected/selectinsertupdate_while_vacuum.out index 5825ccb93f..d3f31b43d4 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/selectinsertupdate_while_vacuum.ans +++ b/src/test/isolation2/expected/selectinsertupdate_while_vacuum.out @@ -1,5 +1,11 @@ -- @Description Ensures that an update during a vacuum operation is ok --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; +INSERT 10 DELETE FROM ao WHERE a < 2; DELETE 1 diff --git a/src/test/isolation2/expected/selectupdate_while_vacuum.out b/src/test/isolation2/expected/selectupdate_while_vacuum.out new file mode 100644 index 0000000000..708e6cd06d --- /dev/null +++ b/src/test/isolation2/expected/selectupdate_while_vacuum.out @@ -0,0 +1,74 @@ +-- @Description Ensures that an update during a vacuum operation is ok +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; +INSERT 1000 + +DELETE FROM ao WHERE a < 128; +DELETE 2032 +4: BEGIN; +BEGIN +4: SELECT COUNT(*) FROM ao; +count +----- +13968 +(1 row) +5: BEGIN; +BEGIN +4: SELECT COUNT(*) FROM ao; +count +----- +13968 +(1 row) +4: BEGIN; +BEGIN +4: SELECT COUNT(*) FROM ao; +count +----- +13968 +(1 row) +2>: VACUUM ao; +4: SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;BEGIN;UPDATE ao SET b=1 WHERE a > 500;UPDATE ao SET b=1 WHERE a > 400;COMMIT; +SELECT +2<: <... completed> +VACUUM +3: SELECT COUNT(*) FROM ao WHERE b = 1; +count +----- +9600 +(1 row) +3: INSERT INTO ao VALUES (0); +INSERT 1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/update_while_vacuum.ans b/src/test/isolation2/expected/update_while_vacuum.out similarity index 68% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/update_while_vacuum.ans rename to src/test/isolation2/expected/update_while_vacuum.out index c667c99a3f..d9e769f945 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/update_while_vacuum.ans +++ b/src/test/isolation2/expected/update_while_vacuum.out @@ -1,5 +1,11 @@ -- @Description Ensures that an update before a vacuum operation is ok --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; +INSERT 100 DELETE FROM ao WHERE a < 12; DELETE 11 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_self_serializable.ans b/src/test/isolation2/expected/vacuum_self_serializable.out similarity index 57% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_self_serializable.ans rename to src/test/isolation2/expected/vacuum_self_serializable.out index 26ceb0e6d8..72b4855552 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_self_serializable.ans +++ b/src/test/isolation2/expected/vacuum_self_serializable.out @@ -1,5 +1,11 @@ -- @Description Ensures that a vacuum with serializable works ok -- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; +INSERT 100 DELETE FROM ao WHERE a < 20; DELETE 19 @@ -10,14 +16,14 @@ count ----- 81 (1 row) -SELECT segno, tupcount FROM gp_aoseg_name('ao'); +SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); segno|tupcount -----+-------- 1 |100 (1 row) VACUUM ao; VACUUM -SELECT segno, tupcount FROM gp_aoseg_name('ao'); +SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); segno|tupcount -----+-------- 1 |0 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_self_serializable2.ans b/src/test/isolation2/expected/vacuum_self_serializable2.out similarity index 55% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_self_serializable2.ans rename to src/test/isolation2/expected/vacuum_self_serializable2.out index 8cd881396a..203d625e55 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_self_serializable2.ans +++ b/src/test/isolation2/expected/vacuum_self_serializable2.out @@ -1,5 +1,15 @@ -- @Description Ensures that a vacuum with serializable works ok --- +-- +DROP TABLE IF EXISTS ao; +DROP +DROP TABLE IF EXISTS ao2; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +CREATE TABLE ao2 (a INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; +INSERT 100 DELETE FROM ao WHERE a < 20; DELETE 19 @@ -17,14 +27,14 @@ count ----- 0 (1 row) -2: SELECT segno, tupcount FROM gp_aoseg_name('ao'); +2: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); segno|tupcount -----+-------- 1 |100 (1 row) 2: VACUUM ao; VACUUM -2: SELECT segno, tupcount FROM gp_aoseg_name('ao'); +2: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); segno|tupcount -----+-------- 1 |0 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_self_serializable3.ans b/src/test/isolation2/expected/vacuum_self_serializable3.out similarity index 52% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_self_serializable3.ans rename to src/test/isolation2/expected/vacuum_self_serializable3.out index 9dac2cd01d..54cdfdd4fa 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_self_serializable3.ans +++ b/src/test/isolation2/expected/vacuum_self_serializable3.out @@ -1,5 +1,15 @@ -- @Description Ensures that a vacuum with serializable works ok --- +-- +DROP TABLE IF EXISTS ao; +DROP +DROP TABLE IF EXISTS ao2; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +CREATE TABLE ao2 (a INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; +INSERT 100 DELETE FROM ao WHERE a < 20; DELETE 19 @@ -10,14 +20,14 @@ count ----- 81 (1 row) -SELECT segno, tupcount FROM gp_aoseg_name('ao'); +SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); segno|tupcount -----+-------- 1 |100 (1 row) VACUUM ao; VACUUM -SELECT segno, tupcount FROM gp_aoseg_name('ao'); +SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); segno|tupcount -----+-------- 1 |0 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_while_insert.ans b/src/test/isolation2/expected/vacuum_while_insert.out similarity index 63% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_while_insert.ans rename to src/test/isolation2/expected/vacuum_while_insert.out index b78068bccb..2d4eb7ca76 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_while_insert.ans +++ b/src/test/isolation2/expected/vacuum_while_insert.out @@ -1,5 +1,51 @@ -- @Description Ensures that a vacuum during insert operations is ok --- +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT) WITH (appendonly=true); +CREATE +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 +insert into ao select generate_series(1,1000); +INSERT 1000 DELETE FROM ao WHERE a < 128; DELETE 2667 diff --git a/src/test/isolation2/expected/vacuum_while_vacuum.out b/src/test/isolation2/expected/vacuum_while_vacuum.out new file mode 100644 index 0000000000..2a1ff677f9 --- /dev/null +++ b/src/test/isolation2/expected/vacuum_while_vacuum.out @@ -0,0 +1,38 @@ +-- @Description Ensures that an vacuum while a vacuum operation is ok +-- +DROP TABLE IF EXISTS ao; +DROP +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i; +INSERT 10000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i; +INSERT 10000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i; +INSERT 10000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i; +INSERT 10000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i; +INSERT 10000 +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i; +INSERT 10000 + +DELETE FROM ao WHERE a < 1200; +DELETE 7194 +1: SELECT COUNT(*) FROM ao; +count +----- +52806 +(1 row) +1>: VACUUM ao; +2: VACUUM ao; +VACUUM +1<: <... completed> +VACUUM +1: SELECT COUNT(*) FROM ao; +count +----- +52806 +(1 row) +3: INSERT INTO ao VALUES (0); +INSERT 1 diff --git a/src/test/isolation2/isolation2_main.c b/src/test/isolation2/isolation2_main.c new file mode 100644 index 0000000000..e16bf599da --- /dev/null +++ b/src/test/isolation2/isolation2_main.c @@ -0,0 +1,95 @@ +/*------------------------------------------------------------------------- + * + * isolation2_main --- pg_regress test launcher for Python isolation tests + * + * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * src/test/isolation2/isolation2_main.c + * + *------------------------------------------------------------------------- + */ + +#include "pg_regress.h" + +/* + * start a Python isolation tester process for specified file (including + * redirection), and return process ID + */ +static PID_TYPE +isolation_start_test(const char *testname, + _stringlist ** resultfiles, + _stringlist ** expectfiles, + _stringlist ** tags) +{ + PID_TYPE pid; + char infile[MAXPGPATH]; + char outfile[MAXPGPATH]; + char expectfile[MAXPGPATH]; + char psql_cmd[MAXPGPATH * 3]; + size_t offset = 0; + + /* + * Look for files in the output dir first, consistent with a vpath search. + * This is mainly to create more reasonable error messages if the file is + * not found. It also allows local test overrides when running pg_regress + * outside of the source tree. + */ + snprintf(infile, sizeof(infile), "%s/sql/%s.sql", + outputdir, testname); + if (!file_exists(infile)) + snprintf(infile, sizeof(infile), "%s/sql/%s.sql", + inputdir, testname); + + snprintf(outfile, sizeof(outfile), "%s/results/%s.out", + outputdir, testname); + + snprintf(expectfile, sizeof(expectfile), "%s/expected/%s.out", + outputdir, testname); + if (!file_exists(expectfile)) + snprintf(expectfile, sizeof(expectfile), "%s/expected/%s.out", + inputdir, testname); + + add_stringlist_item(resultfiles, outfile); + add_stringlist_item(expectfiles, expectfile); + + /* + * GPDB_91_MERGE_FIXME: pg_regress --launcher argument was added in PostgreSQL 9.1. + * We don't have it in GPDB yet. Re-enable this when we merge with 9.1. + */ +#if PG_VERSION_NUM >= 90100 + if (launcher) + offset += snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset, + "%s ", launcher); +#endif + + snprintf(psql_cmd + offset, sizeof(psql_cmd) - offset, + SYSTEMQUOTE "python ./sql_isolation_testcase.py --dbname=\"%s\" < \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE, + dblist->str, + infile, + outfile); + + pid = spawn_process(psql_cmd); + + if (pid == INVALID_PID) + { + fprintf(stderr, _("could not start process for test %s\n"), + testname); + exit_nicely(2); + } + + return pid; +} + +static void +isolation_init(void) +{ + /* set default regression database name */ + add_stringlist_item(&dblist, "isolation2test"); +} + +int +main(int argc, char *argv[]) +{ + return regression_main(argc, argv, isolation_init, isolation_start_test); +} diff --git a/src/test/isolation2/isolation2_schedule b/src/test/isolation2/isolation2_schedule new file mode 100644 index 0000000000..cddcfcba2f --- /dev/null +++ b/src/test/isolation2/isolation2_schedule @@ -0,0 +1,45 @@ + +# Tests on Append-Optimized tables. +test: alter_while_vacuum +test: alter_while_vacuum2 +test: compaction_full_stats +test: compaction_utility +test: compaction_utility_insert +test: cursor_before_delete +test: cursor_before_deletevacuum +test: cursor_before_update +test: cursor_withhold +test: cursor_withhold2 +test: delete_while_vacuum +test: drop_while_vacuum +test: insert_policy +test: insert_while_vacuum +test: locks_reindex +test: max_concurrency +test: max_concurrency2 +test: modcount +test: modcount_vacuum +test: parallel_delete +test: parallel_update +test: parallel_update_readcommitted +test: phantom_reads +test: phantom_reads_delete +test: phantom_reads_serializable +test: phantom_reads_update +test: select_after_vacuum +test: select_after_vacuum_serializable +test: select_before_vacuum +test: select_while_delete +test: select_while_full_vacuum +test: select_while_vacuum +test: select_while_vacuum_serializable +test: select_while_vacuum_serializable2 +test: selectinsert_while_vacuum +test: selectinsertupdate_while_vacuum +test: selectupdate_while_vacuum +test: update_while_vacuum +test: vacuum_self_serializable +test: vacuum_self_serializable2 +test: vacuum_self_serializable3 +test: vacuum_while_insert +test: vacuum_while_vacuum diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum.sql b/src/test/isolation2/sql/alter_while_vacuum.sql similarity index 61% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum.sql rename to src/test/isolation2/sql/alter_while_vacuum.sql index 1ae616afaf..37847e7b5d 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum.sql +++ b/src/test/isolation2/sql/alter_while_vacuum.sql @@ -1,5 +1,8 @@ -- @Description Ensures that an alter table while a vacuum operation is ok -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; DELETE FROM ao WHERE a < 12000; 1: SELECT COUNT(*) FROM ao; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum2_setup.sql b/src/test/isolation2/sql/alter_while_vacuum2.sql similarity index 62% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum2_setup.sql rename to src/test/isolation2/sql/alter_while_vacuum2.sql index 6c2aefd8ef..64f83d1c79 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum2_setup.sql +++ b/src/test/isolation2/sql/alter_while_vacuum2.sql @@ -1,6 +1,5 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description Ensures that an alter table while a vacuum operation is ok +-- DROP TABLE IF EXISTS ao; CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); @@ -11,3 +10,10 @@ INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; +DELETE FROM ao WHERE a < 12000; +1: SELECT COUNT(*) FROM ao; +2: set debug_appendonly_print_compaction=true; +2>: VACUUM ao; +1: Alter table ao set with ( reorganize='true') distributed randomly; +2<: +1: SELECT COUNT(*) FROM ao WHERE a < 12010; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_full_stats.sql b/src/test/isolation2/sql/compaction_full_stats.sql similarity index 52% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_full_stats.sql rename to src/test/isolation2/sql/compaction_full_stats.sql index 359c3f9cec..91f1882f31 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_full_stats.sql +++ b/src/test/isolation2/sql/compaction_full_stats.sql @@ -1,5 +1,12 @@ -- @Description Tests the behavior of full vacuum w.r.t. the pg_class statistics -- +DROP TABLE IF EXISTS foo; + +CREATE TABLE foo (a INT, b INT, c CHAR(128)) WITH (appendonly=true) DISTRIBUTED BY (a); +CREATE INDEX foo_index ON foo(b); +INSERT INTO foo SELECT i as a, i as b, 'hello world' as c FROM generate_series(1, 50) AS i; +INSERT INTO foo SELECT i as a, i as b, 'hello world' as c FROM generate_series(51, 100) AS i; +ANALYZE foo; -- ensure that the scan go through the index SET enable_seqscan=false; @@ -9,4 +16,4 @@ DELETE FROM foo WHERE a < 16; VACUUM FULL foo; SELECT relname, reltuples FROM pg_class WHERE relname = 'foo'; SELECT relname, reltuples FROM pg_class WHERE relname = 'foo_index'; -SELECT segno, tupcount,state FROM gp_aoseg_name('foo'); +SELECT segno, tupcount,state FROM gp_toolkit.__gp_aoseg_name('foo'); diff --git a/src/test/isolation2/sql/compaction_utility.sql b/src/test/isolation2/sql/compaction_utility.sql new file mode 100644 index 0000000000..d0d5654fd3 --- /dev/null +++ b/src/test/isolation2/sql/compaction_utility.sql @@ -0,0 +1,12 @@ +-- @Description Tests the basic behavior of (lazy) vacuum when called from utility mode +-- +DROP TABLE IF EXISTS foo; +CREATE TABLE foo (a INT, b INT, c CHAR(128)) WITH (appendonly=true); +CREATE INDEX foo_index ON foo(b); +INSERT INTO foo SELECT i as a, 1 as b, 'hello world' as c FROM generate_series(1, 100) AS i; + +DELETE FROM foo WHERE a < 20; +SELECT COUNT(*) FROM foo; +2U: VACUUM foo; +SELECT COUNT(*) FROM foo; +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('foo'); diff --git a/src/test/isolation2/sql/compaction_utility_insert.sql b/src/test/isolation2/sql/compaction_utility_insert.sql new file mode 100644 index 0000000000..287c0ebe66 --- /dev/null +++ b/src/test/isolation2/sql/compaction_utility_insert.sql @@ -0,0 +1,18 @@ +-- @Description Tests the compaction of data inserted in utility mode +-- +DROP TABLE IF EXISTS foo; +CREATE TABLE foo (a INT, b INT, c CHAR(128)) WITH (appendonly=true); +CREATE INDEX foo_index ON foo(b); + +INSERT INTO foo VALUES (1, 1, 'c'); +SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); +2U: INSERT INTO foo VALUES (2, 2, 'c'); +2U: INSERT INTO foo VALUES (3, 3, 'c'); +2U: SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); +-- We know that the master does update its tupcount yet +SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); +DELETE FROM foo WHERE a = 2; +UPDATE foo SET b = -1 WHERE a = 3; +VACUUM foo; +2U: SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); +SELECT segno, tupcount, state FROM gp_toolkit.__gp_aoseg_name('foo'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_delete.sql b/src/test/isolation2/sql/cursor_before_delete.sql similarity index 79% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_delete.sql rename to src/test/isolation2/sql/cursor_before_delete.sql index 7eb7ae46ee..c5b68cbb79 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_delete.sql +++ b/src/test/isolation2/sql/cursor_before_delete.sql @@ -1,5 +1,8 @@ -- @Description Tests the visibility when a cursor has been created before the delete. -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT) WITH (appendonly=true); +insert into ao select generate_series(1, 100); 1: BEGIN; 1: DECLARE cur CURSOR FOR SELECT a FROM ao ORDER BY a; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_deletevacuum.sql b/src/test/isolation2/sql/cursor_before_deletevacuum.sql similarity index 79% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_deletevacuum.sql rename to src/test/isolation2/sql/cursor_before_deletevacuum.sql index 35a326c2e0..0c614bdcaa 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_deletevacuum.sql +++ b/src/test/isolation2/sql/cursor_before_deletevacuum.sql @@ -1,5 +1,8 @@ -- @Description Tests the visibility when a cursor has been created before the delete. -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT) WITH (appendonly=true); +insert into ao select generate_series(1, 10); 1: BEGIN; 1: DECLARE cur CURSOR FOR SELECT a FROM ao ORDER BY a; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_update.sql b/src/test/isolation2/sql/cursor_before_update.sql similarity index 75% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_update.sql rename to src/test/isolation2/sql/cursor_before_update.sql index d2560bb50f..249314477b 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_update.sql +++ b/src/test/isolation2/sql/cursor_before_update.sql @@ -1,5 +1,8 @@ -- @Description Tests the visibility when a cursor has been created before the update. -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,100) AS i; 1: BEGIN; 1: DECLARE cur CURSOR FOR SELECT a,b FROM ao ORDER BY a; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold.sql b/src/test/isolation2/sql/cursor_withhold.sql similarity index 78% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold.sql rename to src/test/isolation2/sql/cursor_withhold.sql index 3d01161a34..b372d90d65 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold.sql +++ b/src/test/isolation2/sql/cursor_withhold.sql @@ -1,5 +1,8 @@ -- @Description Tests the visibility of an "with hold" cursor w.r.t. deletes. -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT) WITH (appendonly=true); +insert into ao select generate_series(1,100); 1: DECLARE cur CURSOR WITH HOLD FOR SELECT a FROM ao ORDER BY a; 1: FETCH NEXT IN cur; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold2.sql b/src/test/isolation2/sql/cursor_withhold2.sql similarity index 79% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold2.sql rename to src/test/isolation2/sql/cursor_withhold2.sql index e011755d70..0675005833 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold2.sql +++ b/src/test/isolation2/sql/cursor_withhold2.sql @@ -1,5 +1,8 @@ -- @Description Tests the visibility of an "with hold" cursor w.r.t. deletes. -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT) WITH (appendonly=true); +insert into ao select generate_series(1,10); 1: BEGIN; 1: DECLARE cur CURSOR WITH HOLD FOR SELECT a FROM ao ORDER BY a; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/delete_while_vacuum.sql b/src/test/isolation2/sql/delete_while_vacuum.sql similarity index 62% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/delete_while_vacuum.sql rename to src/test/isolation2/sql/delete_while_vacuum.sql index 24f1ad4826..83c5326bcb 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/delete_while_vacuum.sql +++ b/src/test/isolation2/sql/delete_while_vacuum.sql @@ -1,5 +1,9 @@ -- @Description Ensures that a delete before a vacuum operation is ok -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; + DELETE FROM ao WHERE a < 12; 1: BEGIN; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/drop_while_vacuum.sql b/src/test/isolation2/sql/drop_while_vacuum.sql similarity index 56% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/drop_while_vacuum.sql rename to src/test/isolation2/sql/drop_while_vacuum.sql index 3289a78e68..c21f7e9dea 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/drop_while_vacuum.sql +++ b/src/test/isolation2/sql/drop_while_vacuum.sql @@ -1,5 +1,8 @@ -- @Description Ensures that a drop table while a vacuum operation is ok -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; DELETE FROM ao WHERE a < 12000; 1: SELECT COUNT(*) FROM ao; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_policy_setup.sql b/src/test/isolation2/sql/insert_policy.sql similarity index 86% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_policy_setup.sql rename to src/test/isolation2/sql/insert_policy.sql index e6c39747fa..e68e33294f 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_policy_setup.sql +++ b/src/test/isolation2/sql/insert_policy.sql @@ -1,6 +1,5 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description Tests the AO segment file selection policy +-- DROP TABLE IF EXISTS ao; CREATE TABLE ao (a INT) WITH (appendonly=true); 1: INSERT INTO AO VALUES (1); @@ -129,3 +128,19 @@ CREATE TABLE ao (a INT) WITH (appendonly=true); 1: INSERT INTO AO VALUES (1); 1: INSERT INTO AO VALUES (1); 1: INSERT INTO AO VALUES (1); + +-- Actual test begins +1: INSERT INTO AO VALUES (1); +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +1: INSERT INTO AO VALUES (2); +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +1: BEGIN; +1: INSERT INTO AO VALUES (2); +2: BEGIN; +2: INSERT INTO AO VALUES (2); +1: COMMIT; +2: COMMIT; +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +1: insert into ao select generate_series(1,100000); +1: INSERT INTO AO VALUES (2); +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_while_vacuum.sql b/src/test/isolation2/sql/insert_while_vacuum.sql similarity index 53% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_while_vacuum.sql rename to src/test/isolation2/sql/insert_while_vacuum.sql index b0ee1f82f1..b42af1440e 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_while_vacuum.sql +++ b/src/test/isolation2/sql/insert_while_vacuum.sql @@ -1,5 +1,28 @@ -- @Description Ensures that an insert during a vacuum operation is ok -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT) WITH (appendonly=true); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); DELETE FROM ao WHERE a < 128; 2>: VACUUM ao; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/locks_reindex_setup.sql b/src/test/isolation2/sql/locks_reindex.sql similarity index 70% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/locks_reindex_setup.sql rename to src/test/isolation2/sql/locks_reindex.sql index e3ffc6bd04..eb6de3121c 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/locks_reindex_setup.sql +++ b/src/test/isolation2/sql/locks_reindex.sql @@ -1,8 +1,5 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description The locks held after different operations DROP TABLE IF EXISTS ao; - CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; @@ -26,3 +23,20 @@ create view locktest as select coalesce( l.relation = c.oid and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; + +-- Actual test begins +1: BEGIN; +1: INSERT INTO ao VALUES (200, 200); +SELECT * FROM locktest; +2U: SELECT * FROM locktest; +1: COMMIT; +1: BEGIN; +1: DELETE FROM ao WHERE a = 1; +SELECT * FROM locktest; +2U: SELECT * FROM locktest; +1: COMMIT; +1: BEGIN; +1: UPDATE ao SET b = -1 WHERE a = 2; +SELECT * FROM locktest; +2U: SELECT * FROM locktest; +1: COMMIT; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency.sql b/src/test/isolation2/sql/max_concurrency.sql similarity index 98% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency.sql rename to src/test/isolation2/sql/max_concurrency.sql index 402c3be76e..31ba970134 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency.sql +++ b/src/test/isolation2/sql/max_concurrency.sql @@ -1,5 +1,7 @@ -- @Description Insert into a ao relation with 127 concurrent transactions -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); 1: BEGIN; 2: BEGIN; @@ -383,4 +385,4 @@ 126: COMMIT; 127: COMMIT; SELECT * FROM ao; -SELECT * FROM gp_aoseg_name('ao') ORDER BY segno; +SELECT * FROM gp_toolkit.__gp_aoseg_name('ao') ORDER BY segno; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency2.sql b/src/test/isolation2/sql/max_concurrency2.sql similarity index 94% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency2.sql rename to src/test/isolation2/sql/max_concurrency2.sql index 7e9ab6dc2a..0e3726a95f 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency2.sql +++ b/src/test/isolation2/sql/max_concurrency2.sql @@ -1,6 +1,14 @@ -- @Description Insert into a ao relation with 128 concurrent transactions. -- The 128th transaction is expected to fail. --- +-- +-- +-- start_matchsubs +-- m/could not find segment file to use for inserting into relation ao .*/ +-- s/could not find segment file to use for inserting into relation ao .*/could not find segment file to use for inserting into relation ao ###/ +-- end_matchsubs + +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); 1: BEGIN; 2: BEGIN; @@ -387,4 +395,4 @@ 127: COMMIT; 128: ROLLBACK; SELECT * FROM ao; -SELECT * FROM gp_aoseg_name('ao') ORDER BY segno; +SELECT * FROM gp_toolkit.__gp_aoseg_name('ao') ORDER BY segno; diff --git a/src/test/isolation2/sql/modcount.sql b/src/test/isolation2/sql/modcount.sql new file mode 100644 index 0000000000..2603f997a6 --- /dev/null +++ b/src/test/isolation2/sql/modcount.sql @@ -0,0 +1,13 @@ +-- @Description Tests that DML operatins change the modification count. +-- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; + +SELECT state, tupcount, modcount FROM gp_toolkit.__gp_aoseg_name('ao'); +INSERT INTO ao VALUES (11, 11); +SELECT state, tupcount, modcount FROM gp_toolkit.__gp_aoseg_name('ao'); +DELETE FROM ao WHERE a = 11; +SELECT state, tupcount, modcount FROM gp_toolkit.__gp_aoseg_name('ao'); +UPDATE AO SET b = 0 WHERE a = 10; +SELECT state, tupcount, modcount FROM gp_toolkit.__gp_aoseg_name('ao'); diff --git a/src/test/isolation2/sql/modcount_vacuum.sql b/src/test/isolation2/sql/modcount_vacuum.sql new file mode 100644 index 0000000000..7ddcdbba87 --- /dev/null +++ b/src/test/isolation2/sql/modcount_vacuum.sql @@ -0,0 +1,10 @@ +-- @Description Tests that vacuum is not changing the modification count. +-- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; + +DELETE FROM ao WHERE a < 5; +SELECT state, tupcount, modcount FROM gp_toolkit.__gp_aoseg_name('ao'); +VACUUM ao; +SELECT state, tupcount, modcount FROM gp_toolkit.__gp_aoseg_name('ao'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_delete_setup.sql b/src/test/isolation2/sql/parallel_delete.sql similarity index 58% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_delete_setup.sql rename to src/test/isolation2/sql/parallel_delete.sql index a15e1e19f8..8ef75b872b 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_delete_setup.sql +++ b/src/test/isolation2/sql/parallel_delete.sql @@ -1,8 +1,7 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description Tests that a delete operation in progress will block all other deletes +-- until the transaction is committed. +-- DROP TABLE IF EXISTS ao; - CREATE TABLE ao (a INT) WITH (appendonly=true) DISTRIBUTED BY (a); insert into ao select generate_series(1,100); @@ -18,3 +17,17 @@ create view locktest as select coalesce( l.gp_segment_id = -1 and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; + +-- The actual test begins +1: BEGIN; +2: BEGIN; +2: DELETE FROM ao WHERE a = 1; +2: SELECT * FROM locktest WHERE coalesce = 'ao'; +1&: DELETE FROM ao WHERE a = 2; +2: COMMIT; +1<: +1: COMMIT; +3: BEGIN; +3: SELECT * FROM ao WHERE a < 5 ORDER BY a; +3: COMMIT; +2U: SELECT * FROM gp_toolkit.__gp_aovisimap_name('ao'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update_setup.sql b/src/test/isolation2/sql/parallel_update.sql similarity index 59% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update_setup.sql rename to src/test/isolation2/sql/parallel_update.sql index d50996f495..fe8c8c2818 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update_setup.sql +++ b/src/test/isolation2/sql/parallel_update.sql @@ -1,8 +1,7 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description Tests that a update operation in progress will block all other updates +-- until the transaction is committed. +-- DROP TABLE IF EXISTS ao; - CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; @@ -18,3 +17,15 @@ create view locktest as select coalesce( l.gp_segment_id = -1 and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; + +-- The actual test begins +1: BEGIN; +2: BEGIN; +2: UPDATE ao SET b = 42 WHERE a = 1; +2: SELECT * FROM locktest WHERE coalesce = 'ao'; +1&: UPDATE ao SET b = 42 WHERE a = 2; +2: COMMIT; +1<: +1: COMMIT; +3: SELECT * FROM ao WHERE a < 5 ORDER BY a; +2U: SELECT * FROM gp_toolkit.__gp_aovisimap_name('ao'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update_readcommitted_setup.sql b/src/test/isolation2/sql/parallel_update_readcommitted.sql similarity index 64% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update_readcommitted_setup.sql rename to src/test/isolation2/sql/parallel_update_readcommitted.sql index d50996f495..e1cb4b714d 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update_readcommitted_setup.sql +++ b/src/test/isolation2/sql/parallel_update_readcommitted.sql @@ -1,8 +1,7 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description Tests that a update operation in progress will block all other updates +-- until the transaction is committed. +-- DROP TABLE IF EXISTS ao; - CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; @@ -18,3 +17,13 @@ create view locktest as select coalesce( l.gp_segment_id = -1 and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; + +-- The actual test begins +1: BEGIN; +2: BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED; +1: UPDATE ao SET b = 42 WHERE b = 1; +2&: UPDATE ao SET b = -1 WHERE b = 1; +1: COMMIT; +2<: +2: COMMIT; +SELECT * FROM ao WHERE b < 2; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads.sql b/src/test/isolation2/sql/phantom_reads.sql similarity index 66% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads.sql rename to src/test/isolation2/sql/phantom_reads.sql index 8900826297..39300aa6da 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads.sql +++ b/src/test/isolation2/sql/phantom_reads.sql @@ -1,6 +1,9 @@ -- @Description Tests the basic phantom read behavior of GPDB. -- Actually, no UAO is involved here. -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; 1: BEGIN; 1: SELECT * FROM ao WHERE b BETWEEN 20 AND 30 ORDER BY a; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_delete.sql b/src/test/isolation2/sql/phantom_reads_delete.sql similarity index 67% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_delete.sql rename to src/test/isolation2/sql/phantom_reads_delete.sql index 5cba473777..edf87b5774 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_delete.sql +++ b/src/test/isolation2/sql/phantom_reads_delete.sql @@ -1,6 +1,9 @@ -- @Description Tests the basic phantom read behavior of GPDB w.r.t to delete using -- the default isolation level. -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; 1: BEGIN; 1: SELECT * FROM ao WHERE b BETWEEN 20 AND 30 ORDER BY a; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_serializable.sql b/src/test/isolation2/sql/phantom_reads_serializable.sql similarity index 71% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_serializable.sql rename to src/test/isolation2/sql/phantom_reads_serializable.sql index 07927eca5a..f548c84573 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_serializable.sql +++ b/src/test/isolation2/sql/phantom_reads_serializable.sql @@ -1,6 +1,9 @@ -- @Description Tests the basic phantom read behavior of GPDB with serializable. -- transactions. Actually, no UAO is involved here. -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; 1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; 1: SELECT * FROM ao WHERE b BETWEEN 20 AND 30 ORDER BY a; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_update.sql b/src/test/isolation2/sql/phantom_reads_update.sql similarity index 67% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_update.sql rename to src/test/isolation2/sql/phantom_reads_update.sql index 0adbcf9e27..f1963e32e3 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_update.sql +++ b/src/test/isolation2/sql/phantom_reads_update.sql @@ -1,6 +1,9 @@ -- @Description Tests the basic phantom read behavior of GPDB w.r.t to updates using -- the default isolation level. -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; 1: BEGIN; 1: SELECT * FROM ao WHERE b BETWEEN 20 AND 30 ORDER BY a; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum_setup.sql b/src/test/isolation2/sql/select_after_vacuum.sql similarity index 78% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum_setup.sql rename to src/test/isolation2/sql/select_after_vacuum.sql index edb2d46892..f438cde781 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum_setup.sql +++ b/src/test/isolation2/sql/select_after_vacuum.sql @@ -1,9 +1,7 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description Ensures that a select after a vacuum operation is ok +-- DROP TABLE IF EXISTS ao; DROP TABLE IF EXISTS ao2; - CREATE TABLE ao2 (a INT) WITH (appendonly=true); CREATE TABLE ao (a INT) WITH (appendonly=true); insert into ao select generate_series(1,1000); @@ -41,3 +39,16 @@ create view locktest as select coalesce( l.gp_segment_id = -1 and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; + +-- The actual test begins +DELETE FROM ao WHERE a < 128; +1: BEGIN; +1: SELECT COUNT(*) FROM ao2; +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +2: VACUUM ao; +1: SELECT COUNT(*) FROM ao; +1: SELECT * FROM locktest WHERE coalesce = 'ao'; +1: COMMIT; +1: SELECT COUNT(*) FROM ao; +3: INSERT INTO ao VALUES (0); +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum_serializable_setup.sql b/src/test/isolation2/sql/select_after_vacuum_serializable.sql similarity index 79% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum_serializable_setup.sql rename to src/test/isolation2/sql/select_after_vacuum_serializable.sql index c6de214293..e6bd699089 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum_serializable_setup.sql +++ b/src/test/isolation2/sql/select_after_vacuum_serializable.sql @@ -1,9 +1,7 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description Ensures that a serializable select before during a vacuum operation blocks the vacuum. +-- DROP TABLE IF EXISTS ao; DROP TABLE IF EXISTS ao2; - CREATE TABLE ao (a INT) WITH (appendonly=true); CREATE TABLE ao2 (a INT) WITH (appendonly=true); insert into ao select generate_series(1,1000); @@ -29,3 +27,10 @@ insert into ao select generate_series(1,1000); insert into ao select generate_series(1,1000); insert into ao2 select generate_series(1,1000); +DELETE FROM ao WHERE a < 128; +1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; +1: SELECT COUNT(*) FROM ao2; +2: VACUUM ao; +1: SELECT COUNT(*) FROM ao; +1: COMMIT; +3: INSERT INTO ao VALUES (0); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_before_vacuum_setup.sql b/src/test/isolation2/sql/select_before_vacuum.sql similarity index 84% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_before_vacuum_setup.sql rename to src/test/isolation2/sql/select_before_vacuum.sql index ed2be33b72..e41b0d8001 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_before_vacuum_setup.sql +++ b/src/test/isolation2/sql/select_before_vacuum.sql @@ -1,8 +1,6 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description Ensures that a select before a vacuum operation is ok +-- DROP TABLE IF EXISTS ao; - CREATE TABLE ao (a INT) WITH (appendonly=true); insert into ao select generate_series(1,1000); insert into ao select generate_series(1,1000); @@ -38,3 +36,13 @@ create view locktest as select coalesce( l.gp_segment_id = -1 and relname != 'gp_fault_strategy' and d.datname = current_database() order by 1, 3, 2; + +DELETE FROM ao WHERE a < 128; +1: BEGIN; +1: SELECT COUNT(*) FROM ao; +1: SELECT * FROM locktest WHERE coalesce = 'ao'; +2&: VACUUM ao; +1: COMMIT; +2<: +1: SELECT COUNT(*) FROM ao; +3: INSERT INTO ao VALUES (0); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_delete.sql b/src/test/isolation2/sql/select_while_delete.sql similarity index 69% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_delete.sql rename to src/test/isolation2/sql/select_while_delete.sql index 9f83be70d0..d5502529b5 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_delete.sql +++ b/src/test/isolation2/sql/select_while_delete.sql @@ -1,5 +1,8 @@ -- @Description Ensures that a select during a delete operation is ok -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT) WITH (appendonly=true); +insert into ao select generate_series(1,100); 2: BEGIN; 2: SELECT * FROM ao WHERE a < 5 ORDER BY a; @@ -9,5 +12,5 @@ 2: COMMIT; 2: SELECT * FROM ao WHERE a < 5 ORDER BY a; 4: SELECT * FROM ao WHERE a < 10 ORDER BY a; -2U: SELECT * FROM gp_aovisimap_name('ao'); +2U: SELECT * FROM gp_toolkit.__gp_aovisimap_name('ao'); 4: INSERT INTO ao VALUES (0); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_full_vacuum_setup.sql b/src/test/isolation2/sql/select_while_full_vacuum.sql similarity index 65% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_full_vacuum_setup.sql rename to src/test/isolation2/sql/select_while_full_vacuum.sql index 34096394eb..9434732590 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_full_vacuum_setup.sql +++ b/src/test/isolation2/sql/select_while_full_vacuum.sql @@ -1,8 +1,6 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description Ensures that a select during a full vacuum operation is ok +-- DROP TABLE IF EXISTS ao; - CREATE TABLE ao (a INT) WITH (appendonly=true); insert into ao select generate_series(1,1000); insert into ao select generate_series(1,1000); @@ -26,3 +24,9 @@ insert into ao select generate_series(1,1000); insert into ao select generate_series(1,1000); insert into ao select generate_series(1,1000); +DELETE FROM ao WHERE a < 128; +1: BEGIN; +1>: SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;COMMIT; +2: VACUUM FULL ao; +1<: +3: INSERT INTO ao VALUES (0); diff --git a/src/test/isolation2/sql/select_while_vacuum.sql b/src/test/isolation2/sql/select_while_vacuum.sql new file mode 100644 index 0000000000..14af7a0301 --- /dev/null +++ b/src/test/isolation2/sql/select_while_vacuum.sql @@ -0,0 +1,32 @@ +-- @Description Ensures that a select during a vacuum operation is ok +-- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT) WITH (appendonly=true); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); + +DELETE FROM ao WHERE a < 128; +1: BEGIN; +1>: SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;COMMIT;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;COMMIT; +2: VACUUM ao; +1<: +3: INSERT INTO ao VALUES (0); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_while_vacuum_setup.sql b/src/test/isolation2/sql/select_while_vacuum_serializable.sql similarity index 81% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_while_vacuum_setup.sql rename to src/test/isolation2/sql/select_while_vacuum_serializable.sql index 34096394eb..3e653a9bfc 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_while_vacuum_setup.sql +++ b/src/test/isolation2/sql/select_while_vacuum_serializable.sql @@ -1,8 +1,6 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description Ensures that a select from a serializalbe transaction is ok after vacuum +-- DROP TABLE IF EXISTS ao; - CREATE TABLE ao (a INT) WITH (appendonly=true); insert into ao select generate_series(1,1000); insert into ao select generate_series(1,1000); @@ -26,3 +24,8 @@ insert into ao select generate_series(1,1000); insert into ao select generate_series(1,1000); insert into ao select generate_series(1,1000); +DELETE FROM ao WHERE a < 128; +1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; +2: VACUUM ao; +1: SELECT COUNT(*) FROM ao; +3: INSERT INTO ao VALUES (0); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable2_setup.sql b/src/test/isolation2/sql/select_while_vacuum_serializable2.sql similarity index 70% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable2_setup.sql rename to src/test/isolation2/sql/select_while_vacuum_serializable2.sql index 34096394eb..07378cb130 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable2_setup.sql +++ b/src/test/isolation2/sql/select_while_vacuum_serializable2.sql @@ -1,8 +1,6 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description Ensures that a serializable select before during a vacuum operation avoids the compaction. +-- DROP TABLE IF EXISTS ao; - CREATE TABLE ao (a INT) WITH (appendonly=true); insert into ao select generate_series(1,1000); insert into ao select generate_series(1,1000); @@ -26,3 +24,12 @@ insert into ao select generate_series(1,1000); insert into ao select generate_series(1,1000); insert into ao select generate_series(1,1000); +DELETE FROM ao WHERE a < 128; +1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; +1: SELECT COUNT(*) FROM ao; +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +2: VACUUM ao; +1: SELECT COUNT(*) FROM ao; +1: COMMIT; +3: INSERT INTO ao VALUES (0); +2U: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsert_while_vacuum.sql b/src/test/isolation2/sql/selectinsert_while_vacuum.sql similarity index 56% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsert_while_vacuum.sql rename to src/test/isolation2/sql/selectinsert_while_vacuum.sql index 3102299354..fb9f5b118f 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsert_while_vacuum.sql +++ b/src/test/isolation2/sql/selectinsert_while_vacuum.sql @@ -1,5 +1,28 @@ -- @Description Ensures that an insert during a vacuum operation is ok -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT) WITH (appendonly=true); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); DELETE FROM ao WHERE a < 128; 4: BEGIN; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsertupdate_while_vacuum.sql b/src/test/isolation2/sql/selectinsertupdate_while_vacuum.sql similarity index 69% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsertupdate_while_vacuum.sql rename to src/test/isolation2/sql/selectinsertupdate_while_vacuum.sql index 27c252bbd1..7961ce8fcf 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsertupdate_while_vacuum.sql +++ b/src/test/isolation2/sql/selectinsertupdate_while_vacuum.sql @@ -1,5 +1,8 @@ -- @Description Ensures that an update during a vacuum operation is ok -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; DELETE FROM ao WHERE a < 2; 4: BEGIN; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectupdate_while_vacuum_setup.sql b/src/test/isolation2/sql/selectupdate_while_vacuum.sql similarity index 73% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectupdate_while_vacuum_setup.sql rename to src/test/isolation2/sql/selectupdate_while_vacuum.sql index 8ba215d247..991d2ed4e1 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectupdate_while_vacuum_setup.sql +++ b/src/test/isolation2/sql/selectupdate_while_vacuum.sql @@ -1,8 +1,6 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description Ensures that an update during a vacuum operation is ok +-- DROP TABLE IF EXISTS ao; - CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; @@ -20,3 +18,16 @@ INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,1000) AS i; + +DELETE FROM ao WHERE a < 128; +4: BEGIN; +4: SELECT COUNT(*) FROM ao; +5: BEGIN; +4: SELECT COUNT(*) FROM ao; +4: BEGIN; +4: SELECT COUNT(*) FROM ao; +2>: VACUUM ao; +4: SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;BEGIN;UPDATE ao SET b=1 WHERE a > 500;UPDATE ao SET b=1 WHERE a > 400;COMMIT; +2<: +3: SELECT COUNT(*) FROM ao WHERE b = 1; +3: INSERT INTO ao VALUES (0); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/update_while_vacuum.sql b/src/test/isolation2/sql/update_while_vacuum.sql similarity index 63% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/update_while_vacuum.sql rename to src/test/isolation2/sql/update_while_vacuum.sql index 6d1ceee042..e6f99a4a71 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/update_while_vacuum.sql +++ b/src/test/isolation2/sql/update_while_vacuum.sql @@ -1,5 +1,8 @@ -- @Description Ensures that an update before a vacuum operation is ok -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; DELETE FROM ao WHERE a < 12; 1: BEGIN; diff --git a/src/test/isolation2/sql/vacuum_self_serializable.sql b/src/test/isolation2/sql/vacuum_self_serializable.sql new file mode 100644 index 0000000000..23ba014a6b --- /dev/null +++ b/src/test/isolation2/sql/vacuum_self_serializable.sql @@ -0,0 +1,13 @@ +-- @Description Ensures that a vacuum with serializable works ok +-- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; + +DELETE FROM ao WHERE a < 20; +SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; +SELECT COUNT(*) FROM ao; +SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +VACUUM ao; +SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +SELECT COUNT(*) FROM ao; diff --git a/src/test/isolation2/sql/vacuum_self_serializable2.sql b/src/test/isolation2/sql/vacuum_self_serializable2.sql new file mode 100644 index 0000000000..997169f92c --- /dev/null +++ b/src/test/isolation2/sql/vacuum_self_serializable2.sql @@ -0,0 +1,18 @@ +-- @Description Ensures that a vacuum with serializable works ok +-- +DROP TABLE IF EXISTS ao; +DROP TABLE IF EXISTS ao2; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE TABLE ao2 (a INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; + +DELETE FROM ao WHERE a < 20; +1: SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; +1: SELECT COUNT(*) FROM ao; +1: BEGIN; +1: SELECT COUNT(*) FROM ao2; +2: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +2: VACUUM ao; +2: SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +1: SELECT COUNT(*) FROM ao; +1: COMMIT; diff --git a/src/test/isolation2/sql/vacuum_self_serializable3.sql b/src/test/isolation2/sql/vacuum_self_serializable3.sql new file mode 100644 index 0000000000..f9d1191488 --- /dev/null +++ b/src/test/isolation2/sql/vacuum_self_serializable3.sql @@ -0,0 +1,15 @@ +-- @Description Ensures that a vacuum with serializable works ok +-- +DROP TABLE IF EXISTS ao; +DROP TABLE IF EXISTS ao2; +CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); +CREATE TABLE ao2 (a INT) WITH (appendonly=true); +INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; + +DELETE FROM ao WHERE a < 20; +SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE; +SELECT COUNT(*) FROM ao; +SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +VACUUM ao; +SELECT segno, tupcount FROM gp_toolkit.__gp_aoseg_name('ao'); +SELECT COUNT(*) FROM ao; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_insert.sql b/src/test/isolation2/sql/vacuum_while_insert.sql similarity index 67% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_insert.sql rename to src/test/isolation2/sql/vacuum_while_insert.sql index e1d486728d..4af1ffa9cb 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_insert.sql +++ b/src/test/isolation2/sql/vacuum_while_insert.sql @@ -1,5 +1,28 @@ -- @Description Ensures that a vacuum during insert operations is ok -- +DROP TABLE IF EXISTS ao; +CREATE TABLE ao (a INT) WITH (appendonly=true); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); +insert into ao select generate_series(1,1000); DELETE FROM ao WHERE a < 128; 1: BEGIN; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_vacuum_setup.sql b/src/test/isolation2/sql/vacuum_while_vacuum.sql similarity index 70% rename from src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_vacuum_setup.sql rename to src/test/isolation2/sql/vacuum_while_vacuum.sql index aa593763e2..580dd9fbca 100644 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_vacuum_setup.sql +++ b/src/test/isolation2/sql/vacuum_while_vacuum.sql @@ -1,8 +1,6 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore +-- @Description Ensures that an vacuum while a vacuum operation is ok +-- DROP TABLE IF EXISTS ao; - CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i; INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i; @@ -10,3 +8,11 @@ INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i; INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i; INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i; INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 10000) AS i; + +DELETE FROM ao WHERE a < 1200; +1: SELECT COUNT(*) FROM ao; +1>: VACUUM ao; +2: VACUUM ao; +1<: +1: SELECT COUNT(*) FROM ao; +3: INSERT INTO ao VALUES (0); diff --git a/src/test/isolation2/sql_isolation_testcase.py b/src/test/isolation2/sql_isolation_testcase.py new file mode 100644 index 0000000000..37c0fec2ba --- /dev/null +++ b/src/test/isolation2/sql_isolation_testcase.py @@ -0,0 +1,439 @@ +""" +Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. + +This program and the accompanying materials are made available under +the terms of the under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" + +import pygresql.pg +import os +import subprocess +import re +import multiprocessing +import time +import sys +import socket +from optparse import OptionParser +import traceback + +class SQLIsolationExecutor(object): + def __init__(self, dbname=''): + self.processes = {} + self.command_pattern = re.compile(r"^(\d+)([&\\<\\>Uq]?)\:(.*)") + if dbname: + self.dbname = dbname + else: + self.dbname = os.environ.get('PGDATABASE') + + class SQLConnection(object): + def __init__(self, out_file, name, utility_mode, dbname): + self.name = name + self.utility_mode = utility_mode + self.out_file = out_file + self.dbname = dbname + + parent_conn, child_conn = multiprocessing.Pipe(True) + self.p = multiprocessing.Process(target=self.session_process, args=(child_conn,)) + self.pipe = parent_conn + self.has_open = False + self.p.start() + + # Close "our" copy of the child's handle, so that if the child dies, + # recv() on the pipe will fail. + child_conn.close(); + + self.out_file = out_file + + def session_process(self, pipe): + sp = SQLIsolationExecutor.SQLSessionProcess(self.name, + self.utility_mode, self.out_file.name, pipe, self.dbname) + sp.do() + + def query(self, command): + print >>self.out_file + self.out_file.flush() + if len(command.strip()) == 0: + return + if self.has_open: + raise Exception("Cannot query command while waiting for results") + + self.pipe.send((command, False)) + r = self.pipe.recv() + if r is None: + raise Exception("Execution failed") + print >>self.out_file, r.strip() + + def fork(self, command, blocking): + print >>self.out_file, " " + self.pipe.send((command, True)) + + if blocking: + time.sleep(0.2) + if self.pipe.poll(0): + raise Exception("Forked command is not blocking") + self.has_open = True + + def join(self): + print >>self.out_file, " <... completed>" + r = self.pipe.recv() + if r is None: + raise Exception("Execution failed") + print >>self.out_file, r.strip() + self.has_open = False + + def stop(self): + self.pipe.send(("", False)) + self.p.join() + if self.has_open: + raise Exception("Should not finish test case while waiting for results") + + def quit(self): + print >>self.out_file, "... " + self.stop() + + def terminate(self): + self.pipe.close() + self.p.terminate() + + class SQLSessionProcess(object): + def __init__(self, name, utility_mode, output_file, pipe, dbname): + """ + Constructor + """ + self.name = name + self.utility_mode = utility_mode + self.pipe = pipe + self.dbname = dbname + if self.utility_mode: + (hostname, port) = self.get_utility_mode_port(name) + self.con = pygresql.pg.connect(host=hostname, + port=port, + opt="-c gp_session_role=utility", + dbname=self.dbname) + else: + self.con = pygresql.pg.connect(dbname=self.dbname) + self.filename = "%s.%s" % (output_file, os.getpid()) + + def get_utility_mode_port(self, name): + """ + Gets the port number/hostname combination of the + dbid with the id = name + """ + con = pygresql.pg.connect(dbname=self.dbname) + r = con.query("SELECT hostname, port FROM gp_segment_configuration WHERE dbid = %s" % name).getresult() + if len(r) == 0: + raise Exception("Invalid dbid %s" % name) + if r[0][0] == socket.gethostname(): + return (None, int(r[0][1])) + return (r[0][0], int(r[0][1])) + + def printout_result(self, r): + """ + This is a pretty dirty, but apprently the only way + to get the pretty output of the query result. + The reason is that for some python internal reason + print(r) calls the correct function while neighter str(r) + nor repr(r) output something useful. + """ + with open(self.filename, "w") as f: + print >>f, r, + f.flush() + + with open(self.filename, "r") as f: + ppr = f.read() + return ppr.strip() + "\n" + + def execute_command(self, command): + """ + Executes a given command + """ + try: + r = self.con.query(command) + if r and type(r) == str: + echo_content = command[:-1].partition(" ")[0].upper() + return "%s %s" % (echo_content, self.printout_result(r)) + elif r: + return self.printout_result(r) + else: + echo_content = command[:-1].partition(" ")[0].upper() + return echo_content + except Exception as e: + return str(e) + + def do(self): + """ + Process loop. + Ends when the command None is received + """ + (c, wait) = self.pipe.recv() + while c: + if wait: + time.sleep(0.1) + r = self.execute_command(c) + self.pipe.send(r) + r = None + + (c, wait) = self.pipe.recv() + + if os.path.exists(self.filename): + os.unlink(self.filename) + + def get_process(self, out_file, name, utility_mode=False, dbname=""): + """ + Gets or creates the process by the given name + """ + if len(name) > 0 and not name.isdigit(): + raise Exception("Name should be a number") + if len(name) > 0 and not utility_mode and int(name) >= 1024: + raise Exception("Session name should be smaller than 1024 unless it is utility mode number") + + if not (name, utility_mode) in self.processes: + if not dbname: + dbname = self.dbname + self.processes[(name, utility_mode)] = SQLIsolationExecutor.SQLConnection(out_file, name, utility_mode, dbname) + return self.processes[(name, utility_mode)] + + def quit_process(self, out_file, name, utility_mode=False, dbname=""): + """ + Quits a process with the given name + """ + if len(name) > 0 and not name.isdigit(): + raise Exception("Name should be a number") + if len(name) > 0 and not utility_mode and int(name) >= 1024: + raise Exception("Session name should be smaller than 1024 unless it is utility mode number") + + if not (name, utility_mode) in self.processes: + raise Exception("Sessions not started cannot be quit") + + self.processes[(name, utility_mode)].quit() + del self.processes[(name, False)] + + def process_command(self, command, output_file): + """ + Processes the given command. + The command at this point still includes the isolation behavior + flags, e.g. which session to use. + """ + process_name = "" + sql = command + flag = "" + dbname = "" + m = self.command_pattern.match(command) + if m: + process_name = m.groups()[0] + flag = m.groups()[1] + sql = m.groups()[2] + sql = sql.lstrip() + # If db_name is specifed , it should be of the following syntax: + # 1:@db_name : + if sql.startswith('@db_name'): + sql_parts = sql.split(':', 2) + if not len(sql_parts) == 2: + raise Exception("Invalid syntax with dbname, should be of the form 1:@db_name : ") + if not sql_parts[0].startswith('@db_name'): + raise Exception("Invalid syntax with dbname, should be of the form 1:@db_name : ") + if not len(sql_parts[0].split()) == 2: + raise Exception("Invalid syntax with dbname, should be of the form 1:@db_name : ") + dbname = sql_parts[0].split()[1].strip() + if not dbname: + raise Exception("Invalid syntax with dbname, should be of the form 1:@db_name : ") + sql = sql_parts[1] + if not flag: + self.get_process(output_file, process_name, dbname=dbname).query(sql.strip()) + elif flag == "&": + self.get_process(output_file, process_name, dbname=dbname).fork(sql.strip(), True) + elif flag == ">": + self.get_process(output_file, process_name, dbname=dbname).fork(sql.strip(), False) + elif flag == "<": + if len(sql) > 0: + raise Exception("No query should be given on join") + self.get_process(output_file, process_name, dbname=dbname).join() + elif flag == "U": + self.get_process(output_file, process_name, utility_mode=True, dbname=dbname).query(sql.strip()) + elif flag == "q": + if len(sql) > 0: + raise Exception("No query should be given on quit") + self.quit_process(output_file, process_name, dbname=dbname) + else: + raise Exception("Invalid isolation flag") + + def process_isolation_file(self, sql_file, output_file): + """ + Processes the given sql file and writes the output + to output file + """ + try: + command = "" + for line in sql_file: + #tinctest.logger.info("re.match: %s" %re.match(r"^\d+[q\\<]:$", line)) + print >>output_file, line.strip(), + (command_part, dummy, comment) = line.partition("--") + if command_part == "" or command_part == "\n": + print >>output_file + elif command_part.endswith(";\n") or re.match(r"^\d+[q\\<]:$", line): + command += command_part + #tinctest.logger.info("Processing command: %s" %command) + self.process_command(command, output_file) + command = "" + else: + command += command_part + + for process in self.processes.values(): + process.stop() + except: + for process in self.processes.values(): + process.terminate() + raise + finally: + for process in self.processes.values(): + process.terminate() + +class SQLIsolationTestCase: + """ + The isolation test case allows a fine grained control of interleaved + executing transactions. This is mainly used to test isolation behavior. + An example is: + Execute BEGIN in transaction 1 + Execute BEGIN in transaction 2 + Execute INSERT in transaction 2 + Execute SELECT in transaction 1 + Execute COMMIT in transaction 2 + Execute SELECT in transaction 1 + + The isolation tests are specified identical to sql-scripts in normal + SQLTestCases. However, it is possible to prefix a SQL line with + an tranaction identifier followed by a colon (":"). + The above example would be defined by + 1: BEGIN; + 2: BEGIN; + 2: INSERT INTO a VALUES (1); + 1: SELECT * FROM a; + 2: COMMIT; + 1: SELECT * FROM a; + + Blocking behavior can be tested by forking and joining. + 1: BEGIN; + 2: BEGIN; + 1: DELETE FROM foo WHERE a = 4; + 2&: DELETE FROM foo WHERE a = 4; + 1: COMMIT; + 2<: + 2: COMMIT; + + 2& forks the command. It is executed in the background. If the + command is NOT blocking at this point, it is considered an error. + 2< joins the background command and outputs the result of the + command execution. + + Session ids should be smaller than 1024. + + 2U: Executes a utility command connected to port 40000. + + One difference to SQLTestCase is the output of INSERT. + SQLTestCase would output "INSERT 0 1" if one tuple is inserted. + SQLIsolationTestCase would output "INSERT 1". As the + SQLIsolationTestCase needs to have a more fine-grained control + over the execution order than possible with PSQL, it uses + the pygresql python library instead. + + Connecting to a specific database: + 1. If you specify a db_name metadata in the sql file, connect to that database in all open sessions. + 2. If you want a specific session to be connected to a specific database , specify the sql as follows: + + 1:@db_name testdb: + 2:@db_name test2db: + 1: + 2: + etc + + Here session 1 will be connected to testdb and session 2 will be connected to test2db. You can specify @db_name only at the beginning of the session. For eg:, following would error out: + + 1:@db_name testdb: + 2:@db_name test2db: + 1: @db_name testdb: + 2: + etc + + Quitting sessions: + By default, all opened sessions will be stopped only at the end of the sql file execution. If you want to explicitly quit a session + in the middle of the test execution, you can specify a flag 'q' with the session identifier. For eg: + + 1:@db_name testdb: + 2:@db_name test2db: + 1: + 2: + 1q: + 2: + 3: + 2q: + 3: + 2: @db_name test: + + 1q: ---> Will quit the session established with testdb. + 2q: ---> Will quit the session established with test2db. + + The subsequent 2: @db_name test: will open a new session with the database test and execute the sql against that session. + """ + + def run_sql_file(self, sql_file, out_file = None, out_dir = None, optimizer = None): + """ + Given a sql file and an ans file, this adds the specified gucs (self.gucs) to the sql file , runs the sql + against the test case databse (self.db_name) and verifies the output with the ans file. + If an 'init_file' exists in the same location as the sql_file, this will be used + while doing gpdiff. + """ + # Add gucs to the test sql and form the actual sql file to be run + if not out_dir: + out_dir = self.get_out_dir() + + if not os.path.exists(out_dir): + TINCSystem.make_dirs(out_dir, ignore_exists_error = True) + + if optimizer is None: + gucs_sql_file = os.path.join(out_dir, os.path.basename(sql_file)) + else: + # sql file will be _opt.sql or _planner.sql based on optimizer + gucs_sql_file = os.path.join(out_dir, os.path.basename(sql_file).replace('.sql', '_%s.sql' %self._optimizer_suffix(optimizer))) + + self._add_gucs_to_sql_file(sql_file, gucs_sql_file, optimizer) + self.test_artifacts.append(gucs_sql_file) + + + if not out_file: + if optimizer is None: + out_file = os.path.join(self.get_out_dir(), os.path.basename(sql_file).replace('.sql', '.out')) + else: + # out file will be *_opt.out or *_planner.out based on optimizer + out_file = os.path.join(self.get_out_dir(), os.path.basename(sql_file).replace('.sql', '_%s.out' %self._optimizer_suffix(optimizer))) + + self.test_artifacts.append(out_file) + executor = SQLIsolationExecutor(dbname=self.db_name) + with open(out_file, "w") as f: + executor.process_isolation_file(open(sql_file), f) + f.flush() + + if out_file[-2:] == '.t': + out_file = out_file[:-2] + + return out_file + +if __name__ == "__main__": + + parser = OptionParser() + parser.add_option("--dbname", dest="dbname", + help="connect to database DBNAME", metavar="DBNAME") + (options, args) = parser.parse_args() + + executor = SQLIsolationExecutor(dbname=options.dbname) + + executor.process_isolation_file(sys.stdin, sys.stdout) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/__init__.py b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/alter_while_vacuum2.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/alter_while_vacuum2.ans deleted file mode 100644 index 36defbd6d8..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/alter_while_vacuum2.ans +++ /dev/null @@ -1,22 +0,0 @@ --- @Description Ensures that an alter table while a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 12000; -DELETE 71994 -1: SELECT COUNT(*) FROM ao; -count ------- -528006 -(1 row) -2: set debug_appendonly_print_compaction=true; -SET -2>: VACUUM ao; -1: Alter table ao set with ( reorganize='true') distributed randomly; -ALTER -2<: <... completed> -VACUUM -1: SELECT COUNT(*) FROM ao WHERE a < 12010; -count ------ -60 -(1 row) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/insert_policy.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/insert_policy.ans deleted file mode 100644 index b341c459b2..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/insert_policy.ans +++ /dev/null @@ -1,45 +0,0 @@ --- @Description Tests the AO segment file selection policy --- - -1: INSERT INTO AO VALUES (1); -INSERT 1 -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |127 -(1 row) -1: INSERT INTO AO VALUES (2); -INSERT 1 -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |128 -(1 row) -1: BEGIN; -BEGIN -1: INSERT INTO AO VALUES (2); -INSERT 1 -2: BEGIN; -BEGIN -2: INSERT INTO AO VALUES (2); -INSERT 1 -1: COMMIT; -COMMIT -2: COMMIT; -COMMIT -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |129 -2 | 1 -(2 rows) -1: insert into ao select generate_series(1,100000); -INSERT 100000 -1: INSERT INTO AO VALUES (2); -INSERT 1 -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 | 100129 -2 | 2 -(2 rows) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/insert_policy_2seg.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/insert_policy_2seg.ans deleted file mode 100644 index 9f42dda3db..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/insert_policy_2seg.ans +++ /dev/null @@ -1,45 +0,0 @@ --- @Description Tests the AO segment file selection policy --- - -1: INSERT INTO AO VALUES (1); -INSERT 1 -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |127 -(1 row) -1: INSERT INTO AO VALUES (2); -INSERT 1 -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |127 -(1 row) -1: BEGIN; -BEGIN -1: INSERT INTO AO VALUES (2); -INSERT 1 -2: BEGIN; -BEGIN -2: INSERT INTO AO VALUES (2); -INSERT 1 -1: COMMIT; -COMMIT -2: COMMIT; -COMMIT -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |127 -(1 row) -1: insert into ao select generate_series(1,100000); -INSERT 100000 -1: INSERT INTO AO VALUES (2); -INSERT 1 -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |50128 -(1 row) - - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/insert_while_vacuum.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/insert_while_vacuum.ans deleted file mode 100644 index e641b63dca..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/insert_while_vacuum.ans +++ /dev/null @@ -1,19 +0,0 @@ --- @Description Ensures that an insert during a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 128; -DELETE 2667 -2>: VACUUM ao; -4: BEGIN; -BEGIN -4: insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);insert into ao select generate_series(1001,2000);COMMIT; -INSERT -2<: <... completed> -VACUUM -3: SELECT COUNT(*) FROM ao WHERE a = 1500; -count ------ -20 -(1 row) -4: INSERT INTO ao VALUES (0); -INSERT 1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/modcount_vacuum.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/modcount_vacuum.ans deleted file mode 100644 index cc9d06cf51..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/modcount_vacuum.ans +++ /dev/null @@ -1,18 +0,0 @@ --- @Description Tests that vacuum is not changing the modification count. --- - -DELETE FROM ao WHERE a < 5; -DELETE 4 -SELECT state, tupcount, modcount FROM gp_aoseg_name('ao'); -state|tupcount|modcount ------+--------+-------- -1 |10 |2 -(1 row) -VACUUM ao; -VACUUM -SELECT state, tupcount, modcount FROM gp_aoseg_name('ao'); -state|tupcount|modcount ------+--------+-------- -1 |0 |2 -1 |6 |0 -(2 rows) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_update_readcommitted.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_update_readcommitted.ans deleted file mode 100644 index acba2e32dc..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/parallel_update_readcommitted.ans +++ /dev/null @@ -1,21 +0,0 @@ --- @Description Tests that a update operation in progress will block all other updates --- until the transaction is committed. --- - -1: BEGIN; -BEGIN -2: BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED; -BEGIN -1: UPDATE ao SET b = 42 WHERE b = 1; -UPDATE 1 -2&: UPDATE ao SET b = -1 WHERE b = 1; -1: COMMIT; -COMMIT -2<: <... completed> -UPDATE 0 -2: COMMIT; -COMMIT -SELECT * FROM ao WHERE b < 2; -a|b --+- -(0 rows) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_after_vacuum.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_after_vacuum.ans deleted file mode 100644 index 6865c10928..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_after_vacuum.ans +++ /dev/null @@ -1,44 +0,0 @@ --- @Description Ensures that a select after a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 128; -DELETE 2667 -1: BEGIN; -BEGIN -1: SELECT COUNT(*) FROM ao2; -count ------ -1000 -(1 row) -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |21000 -(1 row) -2: VACUUM ao; -VACUUM -1: SELECT COUNT(*) FROM ao; -count ------ -18333 -(1 row) -1: SELECT * FROM locktest WHERE coalesce = 'ao'; -coalesce|mode |locktype ---------+---------------+-------- -ao |AccessShareLock|relation -(1 row) -1: COMMIT; -COMMIT -1: SELECT COUNT(*) FROM ao; -count ------ -18333 -(1 row) -3: INSERT INTO ao VALUES (0); -INSERT 1 -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |1 -2 |18333 -(2 rows) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_after_vacuum_2seg.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_after_vacuum_2seg.ans deleted file mode 100644 index 101433ba14..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_after_vacuum_2seg.ans +++ /dev/null @@ -1,45 +0,0 @@ --- @Description Ensures that a select after a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 128; -DELETE 2667 -1: BEGIN; -BEGIN -1: SELECT COUNT(*) FROM ao2; -count ------ -1000 -(1 row) -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |10521 -(1 row) -2: VACUUM ao; -VACUUM -1: SELECT COUNT(*) FROM ao; -count ------ -18333 -(1 row) -1: SELECT * FROM locktest WHERE coalesce = 'ao'; -coalesce|mode |locktype ---------+---------------+-------- -ao |AccessShareLock|relation -(1 row) -1: COMMIT; -COMMIT -1: SELECT COUNT(*) FROM ao; -count ------ -18333 -(1 row) -3: INSERT INTO ao VALUES (0); -INSERT 1 -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |0 -2 |9177 -(2 rows) - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_after_vacuum_serializable.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_after_vacuum_serializable.ans deleted file mode 100644 index cf345e45f3..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_after_vacuum_serializable.ans +++ /dev/null @@ -1,23 +0,0 @@ --- @Description Ensures that a serializable select before during a vacuum operation blocks the vacuum. --- - -DELETE FROM ao WHERE a < 128; -DELETE 2667 -1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; -BEGIN -1: SELECT COUNT(*) FROM ao2; -count ------ -1000 -(1 row) -2: VACUUM ao; -VACUUM -1: SELECT COUNT(*) FROM ao; -count ------ -18333 -(1 row) -1: COMMIT; -COMMIT -3: INSERT INTO ao VALUES (0); -INSERT 1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_before_vacuum.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_before_vacuum.ans deleted file mode 100644 index 6e00857bc5..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_before_vacuum.ans +++ /dev/null @@ -1,29 +0,0 @@ --- @Description Ensures that a select before a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 128; -DELETE 2667 -1: BEGIN; -BEGIN -1: SELECT COUNT(*) FROM ao; -count ------ -18333 -(1 row) -1: SELECT * FROM locktest WHERE coalesce = 'ao'; -coalesce|mode |locktype ---------+---------------+-------- -ao |AccessShareLock|relation -(1 row) -2&: VACUUM ao; -1: COMMIT; -COMMIT -2<: <... completed> -VACUUM -1: SELECT COUNT(*) FROM ao; -count ------ -18333 -(1 row) -3: INSERT INTO ao VALUES (0); -INSERT 1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_full_vacuum.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_full_vacuum.ans deleted file mode 100644 index 9c251acb64..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_full_vacuum.ans +++ /dev/null @@ -1,14 +0,0 @@ --- @Description Ensures that a select during a full vacuum operation is ok --- - -DELETE FROM ao WHERE a < 128; -DELETE 2667 -1: BEGIN; -BEGIN -1>: SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;COMMIT; -2: VACUUM FULL ao; -VACUUM -1<: <... completed> -SELECT -3: INSERT INTO ao VALUES (0); -INSERT 1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum.ans deleted file mode 100644 index f30310f5a4..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum.ans +++ /dev/null @@ -1,14 +0,0 @@ --- @Description Ensures that a select during a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 128; -DELETE 2667 -1: BEGIN; -BEGIN -1>: SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;COMMIT;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;COMMIT; -2: VACUUM ao; -VACUUM -1<: <... completed> -SELECT -3: INSERT INTO ao VALUES (0); -INSERT 1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum_serializable.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum_serializable.ans deleted file mode 100644 index 82c13d0381..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum_serializable.ans +++ /dev/null @@ -1,16 +0,0 @@ --- @Description Ensures that a select from a serializalbe transaction is ok after vacuum --- - -DELETE FROM ao WHERE a < 128; -DELETE 2667 -1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; -BEGIN -2: VACUUM ao; -VACUUM -1: SELECT COUNT(*) FROM ao; -count ------ -18333 -(1 row) -3: INSERT INTO ao VALUES (0); -INSERT 1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum_serializable2.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum_serializable2.ans deleted file mode 100644 index ce9a39f4ae..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum_serializable2.ans +++ /dev/null @@ -1,33 +0,0 @@ --- @Description Ensures that a serializable select before during a vacuum operation avoids the compaction. --- - -DELETE FROM ao WHERE a < 128; -DELETE 2667 -1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; -BEGIN -1: SELECT COUNT(*) FROM ao; -count ------ -18333 -(1 row) -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |21000 -(1 row) -2: VACUUM ao; -VACUUM -1: SELECT COUNT(*) FROM ao; -count ------ -18333 -(1 row) -1: COMMIT; -COMMIT -3: INSERT INTO ao VALUES (0); -INSERT 1 -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |21001 -(1 row) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum_serializable2_2seg.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum_serializable2_2seg.ans deleted file mode 100644 index b5193ffe76..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/select_while_vacuum_serializable2_2seg.ans +++ /dev/null @@ -1,33 +0,0 @@ --- @Description Ensures that a serializable select before during a vacuum operation avoids the compaction. --- - -DELETE FROM ao WHERE a < 128; -DELETE 2667 -1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; -BEGIN -1: SELECT COUNT(*) FROM ao; -count ------ -18333 -(1 row) -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |10521 -(1 row) -2: VACUUM ao; -VACUUM -1: SELECT COUNT(*) FROM ao; -count ------ -18333 -(1 row) -1: COMMIT; -COMMIT -3: INSERT INTO ao VALUES (0); -INSERT 1 -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -segno|tupcount ------+-------- -1 |10521 -(1 row) diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/selectupdate_while_vacuum.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/selectupdate_while_vacuum.ans deleted file mode 100644 index 54ddf24797..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/selectupdate_while_vacuum.ans +++ /dev/null @@ -1,38 +0,0 @@ --- @Description Ensures that an update during a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 128; -DELETE 2032 -4: BEGIN; -BEGIN -4: SELECT COUNT(*) FROM ao; -count ------ -13968 -(1 row) -5: BEGIN; -BEGIN -4: SELECT COUNT(*) FROM ao; -count ------ -13968 -(1 row) -4: BEGIN; -BEGIN -4: SELECT COUNT(*) FROM ao; -count ------ -13968 -(1 row) -2>: VACUUM ao; -4: SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;BEGIN;UPDATE ao SET b=1 WHERE a > 500;UPDATE ao SET b=1 WHERE a > 400;COMMIT; -SELECT -2<: <... completed> -VACUUM -3: SELECT COUNT(*) FROM ao WHERE b = 1; -count ------ -9600 -(1 row) -3: INSERT INTO ao VALUES (0); -INSERT 1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_while_vacuum.ans b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_while_vacuum.ans deleted file mode 100644 index 90ccd6b602..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/expected/vacuum_while_vacuum.ans +++ /dev/null @@ -1,22 +0,0 @@ --- @Description Ensures that an vacuum while a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 1200; -DELETE 7194 -1: SELECT COUNT(*) FROM ao; -count ------ -52806 -(1 row) -1>: VACUUM ao; -2: VACUUM ao; -VACUUM -1<: <... completed> -VACUUM -1: SELECT COUNT(*) FROM ao; -count ------ -52806 -(1 row) -3: INSERT INTO ao VALUES (0); -INSERT 1 diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum2.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum2.sql deleted file mode 100644 index 4072e684b6..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum2.sql +++ /dev/null @@ -1,10 +0,0 @@ --- @Description Ensures that an alter table while a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 12000; -1: SELECT COUNT(*) FROM ao; -2: set debug_appendonly_print_compaction=true; -2>: VACUUM ao; -1: Alter table ao set with ( reorganize='true') distributed randomly; -2<: -1: SELECT COUNT(*) FROM ao WHERE a < 12010; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum_setup.sql deleted file mode 100644 index fda57015bb..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/alter_while_vacuum_setup.sql +++ /dev/null @@ -1,8 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_full_stats_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_full_stats_setup.sql deleted file mode 100644 index 573ae221ce..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_full_stats_setup.sql +++ /dev/null @@ -1,11 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS foo; - -CREATE TABLE foo (a INT, b INT, c CHAR(128)) WITH (appendonly=true) DISTRIBUTED BY (a); -CREATE INDEX foo_index ON foo(b); -INSERT INTO foo SELECT i as a, i as b, 'hello world' as c FROM generate_series(1, 50) AS i; -INSERT INTO foo SELECT i as a, i as b, 'hello world' as c FROM generate_series(51, 100) AS i; -ANALYZE foo; - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility.sql deleted file mode 100644 index b2fd509737..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility.sql +++ /dev/null @@ -1,8 +0,0 @@ --- @Description Tests the basic behavior of (lazy) vacuum when called from utility mode --- - -DELETE FROM foo WHERE a < 20; -SELECT COUNT(*) FROM foo; -2U: VACUUM foo; -SELECT COUNT(*) FROM foo; -2U: SELECT segno, tupcount FROM gp_aoseg_name('foo'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility_insert.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility_insert.sql deleted file mode 100644 index 2ccdd34aff..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility_insert.sql +++ /dev/null @@ -1,15 +0,0 @@ --- @Description Tests the compaction of data inserted in utility mode --- - -INSERT INTO foo VALUES (1, 1, 'c'); -SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); -2U: INSERT INTO foo VALUES (2, 2, 'c'); -2U: INSERT INTO foo VALUES (3, 3, 'c'); -2U: SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); --- We know that the master does update its tupcount yet -SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); -DELETE FROM foo WHERE a = 2; -UPDATE foo SET b = -1 WHERE a = 3; -VACUUM foo; -2U: SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); -SELECT segno, tupcount, state FROM gp_aoseg_name('foo'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility_insert_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility_insert_setup.sql deleted file mode 100644 index 03e9913121..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility_insert_setup.sql +++ /dev/null @@ -1,7 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS foo; - -CREATE TABLE foo (a INT, b INT, c CHAR(128)) WITH (appendonly=true); -CREATE INDEX foo_index ON foo(b); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility_setup.sql deleted file mode 100644 index cd87eb4036..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/compaction_utility_setup.sql +++ /dev/null @@ -1,8 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS foo; - -CREATE TABLE foo (a INT, b INT, c CHAR(128)) WITH (appendonly=true); -CREATE INDEX foo_index ON foo(b); -INSERT INTO foo SELECT i as a, 1 as b, 'hello world' as c FROM generate_series(1, 100) AS i; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_delete_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_delete_setup.sql deleted file mode 100644 index 290af60edd..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_delete_setup.sql +++ /dev/null @@ -1,8 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT) WITH (appendonly=true); -insert into ao select generate_series(1, 100); - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_deletevacuum_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_deletevacuum_setup.sql deleted file mode 100644 index a3c59b56eb..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_deletevacuum_setup.sql +++ /dev/null @@ -1,8 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT) WITH (appendonly=true); -insert into ao select generate_series(1, 10); - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_update_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_update_setup.sql deleted file mode 100644 index 86f185e3df..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_before_update_setup.sql +++ /dev/null @@ -1,8 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,100) AS i; - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold2_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold2_setup.sql deleted file mode 100644 index d9ae306c74..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold2_setup.sql +++ /dev/null @@ -1,8 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT) WITH (appendonly=true); -insert into ao select generate_series(1,10); - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold_setup.sql deleted file mode 100644 index 3f22c9dcc3..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/cursor_withhold_setup.sql +++ /dev/null @@ -1,8 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT) WITH (appendonly=true); -insert into ao select generate_series(1,100); - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/delete_while_vacuum_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/delete_while_vacuum_setup.sql deleted file mode 100644 index b59aeed204..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/delete_while_vacuum_setup.sql +++ /dev/null @@ -1,8 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/drop_while_vacuum_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/drop_while_vacuum_setup.sql deleted file mode 100644 index fda57015bb..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/drop_while_vacuum_setup.sql +++ /dev/null @@ -1,8 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100000) AS i; - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_policy.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_policy.sql deleted file mode 100644 index 7da6fb4e97..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/insert_policy.sql +++ /dev/null @@ -1,17 +0,0 @@ --- @Description Tests the AO segment file selection policy --- - -1: INSERT INTO AO VALUES (1); -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -1: INSERT INTO AO VALUES (2); -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -1: BEGIN; -1: INSERT INTO AO VALUES (2); -2: BEGIN; -2: INSERT INTO AO VALUES (2); -1: COMMIT; -2: COMMIT; -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -1: insert into ao select generate_series(1,100000); -1: INSERT INTO AO VALUES (2); -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/locks_reindex.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/locks_reindex.sql deleted file mode 100644 index a16cc3c532..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/locks_reindex.sql +++ /dev/null @@ -1,22 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore --- @Description The locks held after different operations --- --- @product_version gpdb: 4.3.3.0O2 - -1: BEGIN; -1: INSERT INTO ao VALUES (200, 200); -SELECT * FROM locktest; -2U: SELECT * FROM locktest; -1: COMMIT; -1: BEGIN; -1: DELETE FROM ao WHERE a = 1; -SELECT * FROM locktest; -2U: SELECT * FROM locktest; -1: COMMIT; -1: BEGIN; -1: UPDATE ao SET b = -1 WHERE a = 2; -SELECT * FROM locktest; -2U: SELECT * FROM locktest; -1: COMMIT; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency2_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency2_setup.sql deleted file mode 100644 index 9da9ec12da..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency2_setup.sql +++ /dev/null @@ -1,6 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency_setup.sql deleted file mode 100644 index 9da9ec12da..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/max_concurrency_setup.sql +++ /dev/null @@ -1,6 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount.sql deleted file mode 100644 index 38a696a30c..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount.sql +++ /dev/null @@ -1,10 +0,0 @@ --- @Description Tests that DML operatins change the modification count. --- - -SELECT state, tupcount, modcount FROM gp_aoseg_name('ao'); -INSERT INTO ao VALUES (11, 11); -SELECT state, tupcount, modcount FROM gp_aoseg_name('ao'); -DELETE FROM ao WHERE a = 11; -SELECT state, tupcount, modcount FROM gp_aoseg_name('ao'); -UPDATE AO SET b = 0 WHERE a = 10; -SELECT state, tupcount, modcount FROM gp_aoseg_name('ao'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount_setup.sql deleted file mode 100644 index cf2de8f660..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount_setup.sql +++ /dev/null @@ -1,8 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount_vacuum.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount_vacuum.sql deleted file mode 100644 index 0e9a36f7b4..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount_vacuum.sql +++ /dev/null @@ -1,7 +0,0 @@ --- @Description Tests that vacuum is not changing the modification count. --- - -DELETE FROM ao WHERE a < 5; -SELECT state, tupcount, modcount FROM gp_aoseg_name('ao'); -VACUUM ao; -SELECT state, tupcount, modcount FROM gp_aoseg_name('ao'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount_vacuum_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount_vacuum_setup.sql deleted file mode 100644 index cf2de8f660..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/modcount_vacuum_setup.sql +++ /dev/null @@ -1,8 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_delete.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_delete.sql deleted file mode 100644 index e8804e8648..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_delete.sql +++ /dev/null @@ -1,16 +0,0 @@ --- @Description Tests that a delete operation in progress will block all other deletes --- until the transaction is committed. --- - -1: BEGIN; -2: BEGIN; -2: DELETE FROM ao WHERE a = 1; -2: SELECT * FROM locktest WHERE coalesce = 'ao'; -1&: DELETE FROM ao WHERE a = 2; -2: COMMIT; -1<: -1: COMMIT; -3: BEGIN; -3: SELECT * FROM ao WHERE a < 5 ORDER BY a; -3: COMMIT; -2U: SELECT * FROM gp_aovisimap_name('ao'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update.sql deleted file mode 100644 index a19f2fc907..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update.sql +++ /dev/null @@ -1,14 +0,0 @@ --- @Description Tests that a update operation in progress will block all other updates --- until the transaction is committed. --- - -1: BEGIN; -2: BEGIN; -2: UPDATE ao SET b = 42 WHERE a = 1; -2: SELECT * FROM locktest WHERE coalesce = 'ao'; -1&: UPDATE ao SET b = 42 WHERE a = 2; -2: COMMIT; -1<: -1: COMMIT; -3: SELECT * FROM ao WHERE a < 5 ORDER BY a; -2U: SELECT * FROM gp_aovisimap_name('ao'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update_readcommitted.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update_readcommitted.sql deleted file mode 100644 index 691159b054..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/parallel_update_readcommitted.sql +++ /dev/null @@ -1,12 +0,0 @@ --- @Description Tests that a update operation in progress will block all other updates --- until the transaction is committed. --- - -1: BEGIN; -2: BEGIN TRANSACTION ISOLATION LEVEL READ COMMITTED; -1: UPDATE ao SET b = 42 WHERE b = 1; -2&: UPDATE ao SET b = -1 WHERE b = 1; -1: COMMIT; -2<: -2: COMMIT; -SELECT * FROM ao WHERE b < 2; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_delete_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_delete_setup.sql deleted file mode 100644 index 8814272330..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_delete_setup.sql +++ /dev/null @@ -1,7 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_serializable_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_serializable_setup.sql deleted file mode 100644 index 8814272330..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_serializable_setup.sql +++ /dev/null @@ -1,7 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_setup.sql deleted file mode 100644 index 8814272330..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_setup.sql +++ /dev/null @@ -1,7 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_update_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_update_setup.sql deleted file mode 100644 index 8814272330..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/phantom_reads_update_setup.sql +++ /dev/null @@ -1,7 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum.sql deleted file mode 100644 index 9b82ad5546..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum.sql +++ /dev/null @@ -1,14 +0,0 @@ --- @Description Ensures that a select after a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 128; -1: BEGIN; -1: SELECT COUNT(*) FROM ao2; -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -2: VACUUM ao; -1: SELECT COUNT(*) FROM ao; -1: SELECT * FROM locktest WHERE coalesce = 'ao'; -1: COMMIT; -1: SELECT COUNT(*) FROM ao; -3: INSERT INTO ao VALUES (0); -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum_serializable.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum_serializable.sql deleted file mode 100644 index 069017bf26..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_after_vacuum_serializable.sql +++ /dev/null @@ -1,10 +0,0 @@ --- @Description Ensures that a serializable select before during a vacuum operation blocks the vacuum. --- - -DELETE FROM ao WHERE a < 128; -1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; -1: SELECT COUNT(*) FROM ao2; -2: VACUUM ao; -1: SELECT COUNT(*) FROM ao; -1: COMMIT; -3: INSERT INTO ao VALUES (0); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_before_vacuum.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_before_vacuum.sql deleted file mode 100644 index 2bc8e715b9..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_before_vacuum.sql +++ /dev/null @@ -1,12 +0,0 @@ --- @Description Ensures that a select before a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 128; -1: BEGIN; -1: SELECT COUNT(*) FROM ao; -1: SELECT * FROM locktest WHERE coalesce = 'ao'; -2&: VACUUM ao; -1: COMMIT; -2<: -1: SELECT COUNT(*) FROM ao; -3: INSERT INTO ao VALUES (0); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_delete_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_delete_setup.sql deleted file mode 100644 index 3f22c9dcc3..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_delete_setup.sql +++ /dev/null @@ -1,8 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT) WITH (appendonly=true); -insert into ao select generate_series(1,100); - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_full_vacuum.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_full_vacuum.sql deleted file mode 100644 index c73e51d1a7..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_full_vacuum.sql +++ /dev/null @@ -1,9 +0,0 @@ --- @Description Ensures that a select during a full vacuum operation is ok --- - -DELETE FROM ao WHERE a < 128; -1: BEGIN; -1>: SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;COMMIT; -2: VACUUM FULL ao; -1<: -3: INSERT INTO ao VALUES (0); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum.sql deleted file mode 100644 index 48abf7523b..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum.sql +++ /dev/null @@ -1,9 +0,0 @@ --- @Description Ensures that a select during a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 128; -1: BEGIN; -1>: SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;COMMIT;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;COMMIT; -2: VACUUM ao; -1<: -3: INSERT INTO ao VALUES (0); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable.sql deleted file mode 100644 index 32982572ca..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable.sql +++ /dev/null @@ -1,8 +0,0 @@ --- @Description Ensures that a select from a serializalbe transaction is ok after vacuum --- - -DELETE FROM ao WHERE a < 128; -1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; -2: VACUUM ao; -1: SELECT COUNT(*) FROM ao; -3: INSERT INTO ao VALUES (0); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable2.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable2.sql deleted file mode 100644 index a46332c1b8..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable2.sql +++ /dev/null @@ -1,12 +0,0 @@ --- @Description Ensures that a serializable select before during a vacuum operation avoids the compaction. --- - -DELETE FROM ao WHERE a < 128; -1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; -1: SELECT COUNT(*) FROM ao; -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -2: VACUUM ao; -1: SELECT COUNT(*) FROM ao; -1: COMMIT; -3: INSERT INTO ao VALUES (0); -2U: SELECT segno, tupcount FROM gp_aoseg_name('ao'); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable_setup.sql deleted file mode 100644 index 34096394eb..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_serializable_setup.sql +++ /dev/null @@ -1,28 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT) WITH (appendonly=true); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_setup.sql deleted file mode 100644 index 34096394eb..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/select_while_vacuum_setup.sql +++ /dev/null @@ -1,28 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT) WITH (appendonly=true); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsert_while_vacuum_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsert_while_vacuum_setup.sql deleted file mode 100644 index 34096394eb..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsert_while_vacuum_setup.sql +++ /dev/null @@ -1,28 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT) WITH (appendonly=true); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsertupdate_while_vacuum_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsertupdate_while_vacuum_setup.sql deleted file mode 100644 index a8a8de7c42..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectinsertupdate_while_vacuum_setup.sql +++ /dev/null @@ -1,7 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1,10) AS i; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectupdate_while_vacuum.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectupdate_while_vacuum.sql deleted file mode 100644 index bb4334e9c8..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/selectupdate_while_vacuum.sql +++ /dev/null @@ -1,15 +0,0 @@ --- @Description Ensures that an update during a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 128; -4: BEGIN; -4: SELECT COUNT(*) FROM ao; -5: BEGIN; -4: SELECT COUNT(*) FROM ao; -4: BEGIN; -4: SELECT COUNT(*) FROM ao; -2>: VACUUM ao; -4: SELECT COUNT(*) FROM ao;SELECT COUNT(*) FROM ao;BEGIN;UPDATE ao SET b=1 WHERE a > 500;UPDATE ao SET b=1 WHERE a > 400;COMMIT; -2<: -3: SELECT COUNT(*) FROM ao WHERE b = 1; -3: INSERT INTO ao VALUES (0); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/update_while_vacuum_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/update_while_vacuum_setup.sql deleted file mode 100644 index b59aeed204..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/update_while_vacuum_setup.sql +++ /dev/null @@ -1,8 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable.sql deleted file mode 100644 index 9abb970e22..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable.sql +++ /dev/null @@ -1,10 +0,0 @@ --- @Description Ensures that a vacuum with serializable works ok --- - -DELETE FROM ao WHERE a < 20; -SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; -SELECT COUNT(*) FROM ao; -SELECT segno, tupcount FROM gp_aoseg_name('ao'); -VACUUM ao; -SELECT segno, tupcount FROM gp_aoseg_name('ao'); -SELECT COUNT(*) FROM ao; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable2.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable2.sql deleted file mode 100644 index 62d6b801e6..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable2.sql +++ /dev/null @@ -1,13 +0,0 @@ --- @Description Ensures that a vacuum with serializable works ok --- - -DELETE FROM ao WHERE a < 20; -1: SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; -1: SELECT COUNT(*) FROM ao; -1: BEGIN; -1: SELECT COUNT(*) FROM ao2; -2: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -2: VACUUM ao; -2: SELECT segno, tupcount FROM gp_aoseg_name('ao'); -1: SELECT COUNT(*) FROM ao; -1: COMMIT; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable2_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable2_setup.sql deleted file mode 100644 index 02cf8cdfb8..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable2_setup.sql +++ /dev/null @@ -1,9 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; -DROP TABLE IF EXISTS ao2; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -CREATE TABLE ao2 (a INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable3.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable3.sql deleted file mode 100644 index 7632a924de..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable3.sql +++ /dev/null @@ -1,10 +0,0 @@ --- @Description Ensures that a vacuum with serializable works ok --- - -DELETE FROM ao WHERE a < 20; -SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE; -SELECT COUNT(*) FROM ao; -SELECT segno, tupcount FROM gp_aoseg_name('ao'); -VACUUM ao; -SELECT segno, tupcount FROM gp_aoseg_name('ao'); -SELECT COUNT(*) FROM ao; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable3_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable3_setup.sql deleted file mode 100644 index 02cf8cdfb8..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable3_setup.sql +++ /dev/null @@ -1,9 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; -DROP TABLE IF EXISTS ao2; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -CREATE TABLE ao2 (a INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable_setup.sql deleted file mode 100644 index 8814272330..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_self_serializable_setup.sql +++ /dev/null @@ -1,7 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT, b INT) WITH (appendonly=true); -INSERT INTO ao SELECT i as a, i as b FROM generate_series(1, 100) AS i; diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_insert_setup.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_insert_setup.sql deleted file mode 100644 index 34096394eb..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_insert_setup.sql +++ /dev/null @@ -1,28 +0,0 @@ --- start_ignore -SET gp_create_table_random_default_distribution=off; --- end_ignore -DROP TABLE IF EXISTS ao; - -CREATE TABLE ao (a INT) WITH (appendonly=true); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); -insert into ao select generate_series(1,1000); - diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_vacuum.sql b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_vacuum.sql deleted file mode 100644 index 764a7ddb5b..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/sql/vacuum_while_vacuum.sql +++ /dev/null @@ -1,10 +0,0 @@ --- @Description Ensures that an vacuum while a vacuum operation is ok --- - -DELETE FROM ao WHERE a < 1200; -1: SELECT COUNT(*) FROM ao; -1>: VACUUM ao; -2: VACUUM ao; -1<: -1: SELECT COUNT(*) FROM ao; -3: INSERT INTO ao VALUES (0); diff --git a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/test_uao_isolation.py b/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/test_uao_isolation.py deleted file mode 100644 index c8a89cb994..0000000000 --- a/src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_isolation/test_uao_isolation.py +++ /dev/null @@ -1,51 +0,0 @@ -""" -Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. - -This program and the accompanying materials are made available under -the terms of the under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -from mpp.gpdb.tests.storage.lib.sql_isolation_testcase import SQLIsolationTestCase -from mpp.gpdb.tests.storage.lib.uao_udf import create_uao_udf -from mpp.lib.PSQL import PSQL - -class UAOIsolationTestCase(SQLIsolationTestCase): - """ - @tags ORCA - """ - - ''' - Test for UAO tables with different concurrent transactions. - ''' - sql_dir = 'sql/' - ans_dir = 'expected' - out_dir = 'output/' - - @classmethod - def setUpClass(cls): - super(UAOIsolationTestCase, cls).setUpClass() - create_uao_udf() - - def get_output_substitution(self): - return [(r'ERROR: could not find segment file to use for inserting into relation (.+) \((.+)\). \((.+)\)', - r'ERROR: could not find segment file to use for inserting into relation \1 (****). (****)')] - - def get_ans_suffix(self): - primary_segments_count = PSQL.run_sql_command( - "select 'primary_segment' from gp_segment_configuration where content >= 0 and \ - role = 'p'").count('primary_segment') - 1 - if primary_segments_count > 1: - return "%sseg" % primary_segments_count - else: - return None - -- GitLab