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

[core] Support lock for postgres catalog (#4836) #5005

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pratikd650
Copy link

Purpose

Linked issue: close #4836

Currently lock.enabled is only supported my SQLLite and MySQL. Adding support for Postgres.
The only difference between MySQL and Postgres is the TIMESTAMPDIFF function

In MySQL
DELETE FROM paimon_distributed_locks WHERE TIMESTAMPDIFF(SECOND, acquired_at, NOW()) > expire_time_seconds and lock_id = ?

In Postgres
DELETE FROM paimon_distributed_locks WHERE EXTRACT(EPOCH FROM AGE(NOW(), acquired_at)) > expire_time_seconds and lock_id = ?

Tests

PostgresqlCatalogTest.java. This uses TestContainers with postgres:13-alpine to run postgres inside docker.

API and Format

No

Documentation

Yes ,The doc at https://paimon.apache.org/docs/master/flink/sql-ddl/#creating-jdbc-catalog says

Currently, lock configuration is only supported for MySQL and SQLite. If you are using a different type of database for catalog storage, please do not configure lock.enabled.

This needs to updated to include Postgres

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] support lock.enabled for jdbc postgres catalog
2 participants