Skip to content

Conversation

@onurctirtir
Copy link
Member

@onurctirtir onurctirtir commented Nov 10, 2021

Drop Citus might cascade to columnar.options before dropping a
columnar table. In that case, we were getting below error when opening
columnar.options to delete records for the columnar table that we
are about to drop: "ERROR: could not open relation with OID 0".

I somehow reproduced this bug more easily when testing pg upgrade
scenarios, probably because OID's of columnar metadata tables gets
re-written when upgrading pg. That is why I added the test to
after_pg_upgrade_schedule, which easily reproduces the bug after
reverting the fix done in columnar_metadata.c

DESCRIPTION: Fixes a bug that could break DROP SCHEMA/EXTENSON commands when there is a columnar table

Drop extension might cascade to columnar.options before dropping a
columnar table. In that case, we were getting below error when opening
columnar.options to delete records for the columnar table that we are
about to drop.: "ERROR:  could not open relation with OID 0".

I somehow reproduced this bug easily when upgrading pg, that is why
adding added the test to after_pg_upgrade_schedule.
Comment on lines +340 to +344
if (columnarOptions == NULL)
{
/* extension has been dropped */
return false;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we do in DeleteMetadataRows ...

@codecov
Copy link

codecov bot commented Nov 10, 2021

Codecov Report

Merging #5458 (c74acef) into master (1aa32d5) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #5458      +/-   ##
==========================================
- Coverage   92.72%   92.72%   -0.01%     
==========================================
  Files         215      215              
  Lines       45274    45276       +2     
==========================================
- Hits        41981    41980       -1     
- Misses       3293     3296       +3     

@onurctirtir onurctirtir merged commit 25024b7 into master Nov 12, 2021
@onurctirtir onurctirtir deleted the col/skip-options branch November 12, 2021 09:30
onurctirtir added a commit that referenced this pull request Nov 12, 2021
Drop extension might cascade to columnar.options before dropping a
columnar table. In that case, we were getting below error when opening
columnar.options to delete records for the columnar table that we are
about to drop.: "ERROR:  could not open relation with OID 0".

I somehow reproduced this bug easily when upgrading pg, that is why
adding added the test to after_pg_upgrade_schedule.

(cherry picked from commit 25024b7)

 Conflicts:
	src/test/regress/after_pg_upgrade_schedule
	src/test/regress/expected/upgrade_columnar_after.out
	src/test/regress/sql/upgrade_columnar_after.sql
onurctirtir added a commit that referenced this pull request Nov 12, 2021
Drop extension might cascade to columnar.options before dropping a
columnar table. In that case, we were getting below error when opening
columnar.options to delete records for the columnar table that we are
about to drop.: "ERROR:  could not open relation with OID 0".

I somehow reproduced this bug easily when upgrading pg, that is why
adding added the test to after_pg_upgrade_schedule.

(cherry picked from commit 25024b7)

 Conflicts:
	src/test/regress/after_pg_upgrade_schedule
	src/test/regress/expected/upgrade_columnar_after.out
	src/test/regress/sql/upgrade_columnar_after.sql
onurctirtir added a commit that referenced this pull request Nov 12, 2021
Drop extension might cascade to columnar.options before dropping a
columnar table. In that case, we were getting below error when opening
columnar.options to delete records for the columnar table that we are
about to drop.: "ERROR:  could not open relation with OID 0".

I somehow reproduced this bug easily when upgrading pg, that is why
adding added the test to after_pg_upgrade_schedule.

(cherry picked from commit 25024b7)

 Conflicts:
	src/test/regress/after_pg_upgrade_schedule
onurctirtir added a commit that referenced this pull request Nov 12, 2021
Drop extension might cascade to columnar.options before dropping a
columnar table. In that case, we were getting below error when opening
columnar.options to delete records for the columnar table that we are
about to drop.: "ERROR:  could not open relation with OID 0".

I somehow reproduced this bug easily when upgrading pg, that is why
adding added the test to after_pg_upgrade_schedule.

(cherry picked from commit 25024b7)

 Conflicts:
	src/test/regress/after_pg_upgrade_schedule
	src/test/regress/expected/upgrade_columnar_after.out
	src/test/regress/sql/upgrade_columnar_after.sql
onurctirtir added a commit that referenced this pull request Nov 12, 2021
Drop extension might cascade to columnar.options before dropping a
columnar table. In that case, we were getting below error when opening
columnar.options to delete records for the columnar table that we are
about to drop.: "ERROR:  could not open relation with OID 0".

I somehow reproduced this bug easily when upgrading pg, that is why
adding added the test to after_pg_upgrade_schedule.

(cherry picked from commit 25024b7)

 Conflicts:
	src/test/regress/after_pg_upgrade_schedule
	src/test/regress/expected/upgrade_columnar_after.out
	src/test/regress/sql/upgrade_columnar_after.sql
onurctirtir added a commit that referenced this pull request Nov 12, 2021
Drop extension might cascade to columnar.options before dropping a
columnar table. In that case, we were getting below error when opening
columnar.options to delete records for the columnar table that we are
about to drop.: "ERROR:  could not open relation with OID 0".

I somehow reproduced this bug easily when upgrading pg, that is why
adding added the test to after_pg_upgrade_schedule.

(cherry picked from commit 25024b7)

 Conflicts:
	src/test/regress/after_pg_upgrade_schedule
	src/test/regress/expected/upgrade_columnar_after.out
	src/test/regress/sql/upgrade_columnar_after.sql
@onurctirtir
Copy link
Member Author

(backported to those three branches, so removing labels)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

columnar dev_reported to track issues reported by the development team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants