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

Postgres 14 #2607

Merged
merged 3 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/db-migration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Usage: $ ./db-migration.sh

# Version of PostgreSQL
readonly POSTGRES_VERSION="12.1"
readonly POSTGRES_VERSION="14"
# Version of Marquez
readonly MARQUEZ_VERSION=0.40.0
# Build version of Marquez
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Marquez uses a _multi_-project structure and contains the following modules:
## Requirements

* [Java 17](https://adoptium.net)
* [PostgreSQL 12.1](https://www.postgresql.org/download)
* [PostgreSQL 14](https://www.postgresql.org/download)

> **Note:** To connect to your running PostgreSQL instance, you will need the standard [`psql`](https://www.postgresql.org/docs/9.6/app-psql.html) tool.

Expand Down
12 changes: 12 additions & 0 deletions api/src/main/java/marquez/db/migrations/V57_1__BackfillFacets.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ public void migrate(Context context) throws Exception {
}

int estimatedEventsCount = estimateCountLineageEvents();

if (estimatedEventsCount < 0) {
// https://www.postgresql.org/docs/current/catalog-pg-class.html
// -1 indicating that the row count is unknown.
// This happens when lineage_events table is empty.
log.info("Vacuuming lineage_events table");
jdbi.withHandle(h -> h.execute("VACUUM lineage_events;"));
log.info("Vacuuming lineage_events table finished");

estimatedEventsCount = estimateCountLineageEvents();
}

log.info("Estimating {} events in lineage_events table", estimatedEventsCount);
if (estimatedEventsCount == 0 && countLineageEvents() == 0) {
// lineage_events table is empty -> no need to run migration
Expand Down
2 changes: 1 addition & 1 deletion api/src/test/java/marquez/PostgresContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.testcontainers.utility.DockerImageName;

public final class PostgresContainer extends PostgreSQLContainer<PostgresContainer> {
private static final DockerImageName POSTGRES = DockerImageName.parse("postgres:12.12");
private static final DockerImageName POSTGRES = DockerImageName.parse("postgres:14");
private static final int JDBC = 5;

private static final Map<String, PostgresContainer> containers = new HashMap<>();
Expand Down
2 changes: 1 addition & 1 deletion api/src/test/java/marquez/db/DbTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@Tag("DataAccessTests")
@Testcontainers
class DbTest {
private static final DockerImageName POSTGRES_12_1 = DockerImageName.parse("postgres:12.1");
private static final DockerImageName POSTGRES_12_1 = DockerImageName.parse("postgres:14");

@Container
private static final PostgreSQLContainer<?> DB_CONTAINER =
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.db.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.7"
services:
db:
image: postgres:12.1
image: postgres:14
container_name: marquez-db
ports:
- "5432:5432"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
entrypoint: ["/opt/marquez/wait-for-it.sh", "db:5432", "--", "./entrypoint.sh"]

db:
image: postgres:12.1
image: postgres:14
container_name: marquez-db
ports:
- "5432:5432"
Expand Down