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

[YSQL] Warning: leaking still-referenced relcache entry #1090

Closed
m-iancu opened this issue Mar 29, 2019 · 1 comment
Closed

[YSQL] Warning: leaking still-referenced relcache entry #1090

m-iancu opened this issue Mar 29, 2019 · 1 comment
Assignees
Labels
kind/bug This issue is a bug

Comments

@m-iancu
Copy link
Contributor

m-iancu commented Mar 29, 2019

Can happen for some mixes DMLs with DDLs from multiple connections.
To replicate:

  1. start two connections at the same time with :
./bin/psql -h 127.0.0.1 -p 5433 -U postgres
  1. In connection 1 run:
postgres=# create table test2 (b int);
CREATE TABLE
  1. in connection 2:
postgres=#  insert into test2(non_existent_column) values (1);
WARNING:  leaking still-referenced relcache entry for "test2"
ERROR:  column "non_existent_column" of relation "test2" does not exist
LINE 1: insert into test2(non_existent_column) values (1);
@m-iancu m-iancu self-assigned this Mar 29, 2019
yugabyte-ci pushed a commit that referenced this issue Apr 2, 2019
Summary:
- Use the relcache file to store relation cache data, add ysql catalog version to
  detect (and clean up) old (no longer valid) files.
- No longer preload catcache (only relcache) for backend connections except during
  initdb which makes heavy use of various relations and builtins.
- No longer increment catalog version for inserts, only for updates/deletes. Since we don't do
  negative caching, inserts (e.g. from CREATE TABLE) do not invalidate the cache, only
  updates/deletes (e.g. ALTER or DROP TABLE).
- Fix a cache refrence leak bug and clean up the logic for retry and cache-refresh due to
  catalog version mismatches.

Test Plan:
jenkins, TestPgCacheConsistency, sample apps with high number of connections:
java -jar ./target/yb-sample-apps.jar --workload SqlInserts --nodes 127.0.0.1:5433 --num_threads_write 99 --num_threads_read 0 --num_unique_keys 1000000000

Reviewers: mikhail, robert

Reviewed By: robert

Subscribers: yql, bogdan

Differential Revision: https://phabricator.dev.yugabyte.com/D6412
@m-iancu
Copy link
Contributor Author

m-iancu commented Apr 2, 2019

Closed in 465b6d6.

@m-iancu m-iancu closed this as completed Apr 2, 2019
@m-iancu m-iancu added the kind/bug This issue is a bug label Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This issue is a bug
Projects
None yet
Development

No branches or pull requests

1 participant