isolation2 lockmodes fails on cassert builds: extra AccessShareLock on partition root

Đang mở Phù hợp với người mới
#2,356 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@tuhaihe đang làm issue này rồi.

Từ ngày 19/11/2026.

  • #2357 của @tuhaihe — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, postgresql
Lĩnh vực
databases, testing

Hướng nghiên cứu

Bắt đầu với bài kiểm thử lockmodes của isolation2 và các tệp đầu ra dự kiến của nó; issue xác định trường hợp GDD-off INSERT INTO t_lockmods_part_tbl_dml và giải thích hành vi cassert relcache. Kết thúc session 1 trước trường hợp đó, rồi cập nhật các tệp dự kiến. Hoàn thành khi bài kiểm thử chạy thành công trên các bản build bật assert và có ORCA, đồng thời đầu ra lock dự kiến khớp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

The isolation2 lockmodes test fails on assert-enabled builds (--enable-cassert) with ORCA on. Seen on the Debug workflow in #2328, same diff on two runs:

 1: select * from show_locks_lockmodes;
  locktype | mode             | granted | relation
 ----------+------------------+---------+---------------------------------
+ relation | AccessShareLock  | t       | t_lockmods_part_tbl_dml
  relation | RowExclusiveLock | t       | t_lockmods_part_tbl_dml
  relation | RowExclusiveLock | t       | t_lockmods_part_tbl_dml_1_prt_1
  relation | RowExclusiveLock | t       | t_lockmods_part_tbl_dml_1_prt_2
-(3 rows)
+(4 rows)

https://github.com/apache/cloudberry/actions/runs/44457186410/job/135340162927

This is the GDD-off INSERT INTO t_lockmods_part_tbl_dml ... case. The test already explains why the extra lock appears: with cassert, RELCACHE_FORCE_RELEASE drops the relcache entry on close, so generate_partition_qual() reopens the root with AccessShareLock. That's why the later cases start with 1q:, so they always run without a cached relcache.

The INSERT case (added in 454814d0e8f) sits before that comment and reuses session 1. On a Release build the root is still cached, so there's no lock; on a cassert build there is.

Fix: quit session 1 before the INSERT case and update the expected files.

Ngôn ngữ chính
C
Star
1.4k
Fork
273
Merge trung bình
4 ngày 6 giờ
Pull request đã merge (30 ngày)
105

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/cloudberry

Tất cả issue của apache/cloudberry

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.