Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Refresh append-only materialized view with index #865

Closed
1 of 2 tasks
roseduan opened this issue Jan 13, 2025 · 3 comments · Fixed by #866
Closed
1 of 2 tasks

[Bug] Refresh append-only materialized view with index #865

roseduan opened this issue Jan 13, 2025 · 3 comments · Fixed by #866
Labels
type: Bug Something isn't working

Comments

@roseduan
Copy link
Contributor

Apache Cloudberry version

main

What happened

postgres=# REFRESH MATERIALIZED VIEW matview_test;
ERROR: could not open relation with OID 0 (seg0 127.0.0.1:7002 pid=30712)
DETAIL: This can be validly caused by a concurrent delete operation on this object.

What you think should happen instead

No response

How to reproduce

set default_table_access_method TO AO_ROW;

CREATE TABLE events
(
    id           bigint NOT NULL,
    user_id      bigint
);
insert into events values (1, 1), (2, 1), (3, 2), (4, 2), (5, 3), (6, 3), (7, 4), (8, 4), (9, 5), (10, 5);

CREATE MATERIALIZED VIEW matview_test AS SELECT * FROM events WHERE id < 6;
CREATE INDEX idxmatview_test ON matview_test USING btree (user_id);

BEGIN;
UPDATE events SET id = id WHERE id = 1;
UPDATE events SET id = id WHERE id = 2;
UPDATE events SET id = id WHERE id = 3;
COMMIT;

VACUUM events;

REFRESH MATERIALIZED VIEW matview_test;

Operating System

CentOS 7

Anything else

No response

Are you willing to submit PR?

  • Yes, I am willing to submit a PR!

Code of Conduct

@roseduan roseduan added the type: Bug Something isn't working label Jan 13, 2025
Copy link

Hi, @roseduan welcome!🎊 Thanks for taking the time to point this out.🙌

@avamingli
Copy link
Contributor

I tested this on tag 1.5.0 and found that the issue also exists there. It has been present since our open-source release, indicating that it’s a real bug that has existed for a long time.

avamingli added a commit to avamingli/cloudberrydb that referenced this issue Jan 13, 2025
Fix: apache#865

Implemented a solution that creates a block directory for materialized
views using AO/AOCS storage with an index.
This fix prevents errors that occur when refreshing materialized views
in AO/AOCS storage.

Authored-by: Zhang Mingli avamingli@gmail.com
@avamingli
Copy link
Contributor

Fix in #866

avamingli added a commit to avamingli/cloudberrydb that referenced this issue Jan 13, 2025
Fix: apache#865

Implemented a solution that creates a block directory for materialized
views using AO/AOCS storage with an index.
This fix prevents errors that occur when refreshing materialized views
in AO/AOCS storage.

Authored-by: Zhang Mingli avamingli@gmail.com
avamingli added a commit to avamingli/cloudberrydb that referenced this issue Jan 14, 2025
Fix: apache#865

Implemented a solution that creates a block directory for materialized
views using AO/AOCS storage with an index.
This fix prevents errors that occur when refreshing materialized views
in AO/AOCS storage.

Authored-by: Zhang Mingli avamingli@gmail.com
avamingli added a commit that referenced this issue Jan 14, 2025
Fix: #865

Implemented a solution that creates a block directory for materialized
views using AO/AOCS storage with an index.
This fix prevents errors that occur when refreshing materialized views
in AO/AOCS storage.

Authored-by: Zhang Mingli avamingli@gmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants