Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
c20a29b
cache: lineage cache, per-type metrics, invalidation registry, search…
harshach May 10, 2026
68614cf
cache: phase 2 ops + correctness — single-flight, slow-read, negative…
harshach May 10, 2026
a503baa
cache: pipelined mget on CacheProvider + CachedReadBundle.getBatch
harshach May 10, 2026
a6a6cb9
test(cache): use unique query in sameQueryHitsCacheOnSecondCall to av…
harshach May 10, 2026
4148905
cache: drop search cache TTL from 30s to 2s for create-then-search fr…
harshach May 10, 2026
9ae7f57
ci: cache-tests profile runs full IT suite + new postgres+es+redis CI…
harshach May 10, 2026
3e0effc
fix(cache): address PR review feedback for cache improvements
harshach May 10, 2026
72e2cad
fix(cache): only negative-cache on real EntityNotFoundException
harshach May 11, 2026
db67dfb
fix(cache): copilot review — blank param, javadoc, mget hardening
harshach May 11, 2026
5ff45c5
fix(cache): mget partial timeout must trip the circuit breaker
harshach May 12, 2026
8fbd0f3
fix(cache): mget shorter critical section + cache/stats + cache/keys doc
harshach May 12, 2026
10a29dd
Merge branch 'main' into harshach/redis-cache-perf-check
pmbrull May 12, 2026
ab808a9
fix(cache): copilot review pass 3 — hot-path L1 check + lineage hash …
harshach May 12, 2026
b338c8f
fix(cache): lineage hash TTL claimed only by first writer (EXPIRE NX)
harshach May 13, 2026
3c1dffa
fix(cache): mget unavailable-path alignment + lineage deser fallback
harshach May 13, 2026
aaa6612
fix(cache): expireIfAbsent falls back to plain EXPIRE on NX failure
harshach May 13, 2026
7972624
fix(cache): copilot review pass 5 — dedicated mget conn + breaker + I…
harshach May 13, 2026
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
178 changes: 178 additions & 0 deletions .github/workflows/integration-tests-postgres-elasticsearch-redis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# Copyright 2026 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Runs the full integration test suite with the Redis cache enabled (postgres + elasticsearch +
# redis), via the cache-tests Maven profile. Catches cache-invalidation and stale-data bugs that
# only surface when every test path goes through the cache layer.
#
# Security note (CodeQL "pull_request_target + checkout untrusted code"):
# This workflow uses `pull_request_target` so PRs from forks can produce a required check.
# CodeQL flags the pattern as risky because it checks out PR-controlled code while having
# access to secrets. The mitigation is the explicit `safe to test` label gate below — the
# verify-pr-label step rejects the workflow run before any PR code is checked out unless a
# maintainer has applied the label. This matches the mitigation used by every other
# integration-tests-*.yml workflow in this repo. If you remove the label gate, you reopen
# the vulnerability.
name: Integration Tests - PostgreSQL + Elasticsearch + Redis

on:
merge_group:
workflow_dispatch:
push:
branches:
- main
paths:
- "openmetadata-service/**"
- "openmetadata-integration-tests/**"
- "openmetadata-spec/src/main/resources/json/schema/**"
- "openmetadata-sdk/**"
- "common/**"
- "pom.xml"
- "bootstrap/**"
# `pull_request_target` is intentional and required so the workflow runs against PRs from
# forks (which `pull_request` cannot for security reasons). The `safe to test` label gate
# below is what makes this safe — see security note in the file header.
pull_request_target:
types: [labeled, opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
checks: write

concurrency:
group: integration-tests-pg-es-redis-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
# Detect whether relevant paths changed. When no matching files are modified
# the downstream job is skipped via its `if` condition.
# A job skipped by `if` reports as "Success", so required checks still pass.
changes:
name: Detect Changes
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
outputs:
backend: ${{ github.event_name == 'workflow_dispatch' && 'true' || steps.filter.outputs.backend }}
steps:
- uses: dorny/paths-filter@v3
id: filter
if: ${{ github.event_name != 'workflow_dispatch' }}
with:
filters: |
backend:
- 'openmetadata-service/**'
- 'openmetadata-integration-tests/**'
- 'openmetadata-spec/src/main/resources/json/schema/**'
- 'openmetadata-sdk/**'
- 'common/**'
- 'pom.xml'
- 'bootstrap/**'

integration-tests-postgres-elasticsearch-redis:
needs: changes
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.backend == 'true' }}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true

- name: Wait for the labeler
uses: lewagon/wait-on-check-action@v1.3.4
if: ${{ github.event_name == 'pull_request_target' }}
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: Team Label
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 90

- name: Verify PR labels
uses: jesusvasquez333/verify-pr-label-action@v1.4.0
if: ${{ github.event_name == 'pull_request_target' }}
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
valid-labels: 'safe to test'
pull-request-number: '${{ github.event.pull_request.number }}'
disable-reviews: true # To not auto approve changes

# SECURITY: this step checks out PR-controlled code while the workflow runs with
# `pull_request_target` privileges (secrets access). The `Verify PR labels` step above
# gates this — the workflow halts before we get here unless a maintainer has applied
# the `safe to test` label. CodeQL flags the pattern; the label gate is the accepted
# mitigation, mirroring how every other integration-tests-*.yml workflow in this repo
# handles fork PRs.
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'merge_group' && github.sha || github.event.pull_request.head.sha }}

- name: Cache Maven dependencies
id: cache-output
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

# Run unconditionally. The previous `if: steps.cache-output.outputs.exit-code == 0` was a
# bug — `actions/cache@v4` exposes `cache-hit` (boolean) and `cache-primary-key`, never
# `exit-code`. The expression always evaluated to false and the steps never ran. Maven
# then ran against whatever JDK the runner happened to ship with, masking the issue.
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Install Ubuntu dependencies
run: |
sudo apt-get update
sudo apt-get install -y unixodbc-dev python3-venv librdkafka-dev gcc libsasl2-dev build-essential libssl-dev libffi-dev \
librdkafka-dev unixodbc-dev libevent-dev jq
sudo make install_antlr_cli

- name: Build for Integration Tests (PostgreSQL + Elasticsearch + Redis)
Comment thread
harshach marked this conversation as resolved.
Dismissed
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn -DskipTests clean install -pl :openmetadata-integration-tests -am

- name: Free build artifacts
Comment thread
harshach marked this conversation as resolved.
Dismissed
run: |
rm -rf openmetadata-service/target/lib openmetadata-service/target/classes
rm -rf openmetadata-spec/target openmetadata-sdk/target common/target
rm -rf openmetadata-shaded-deps/*/target
df -h /

- name: Run Integration Tests (PostgreSQL + Elasticsearch + Redis)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn verify -pl :openmetadata-integration-tests -Pcache-tests

- name: Clean Up
Comment thread
harshach marked this conversation as resolved.
Dismissed
run: |
cd ./docker/development
docker compose down --remove-orphans
sudo rm -rf ${PWD}/docker-volume

- name: Publish Test Report
if: ${{ always() }}
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_on_test_failures: true
report_paths: 'openmetadata-integration-tests/target/failsafe-reports/TEST-*.xml'
8 changes: 8 additions & 0 deletions docker/development/docker-compose.cache-off.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Override that disables the cache while leaving the rest of the stack intact.
# Used in the local A/B benchmark to flip cache off without tearing down volumes.
# Apply on TOP of base compose (NOT the redis overlay):
# docker compose -f docker-compose.yml -f docker-compose.cache-off.yml up -d --no-deps openmetadata-server
services:
openmetadata-server:
environment:
CACHE_PROVIDER: none
70 changes: 64 additions & 6 deletions openmetadata-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -796,29 +796,47 @@
</plugins>
</build>
</profile>
<!-- Redis cache correctness tests — fastest profile for verifying that mutations
invalidate the right keys. Brings up a Redis container, runs only the cache
correctness ITs, skips the heavier search/DB matrix. -->
<!-- Full integration test suite with postgres + elasticsearch + redis cache enabled.
Same shape as mysql-elasticsearch (sequential + parallel) but with cacheProvider=redis
so every test exercises the cache code paths too — catches stale-data and
invalidation bugs across the whole codebase, not just cache/* tests. -->
<profile>
<id>cache-tests</id>
<!--
Full integration test suite with postgres + elasticsearch + redis cache enabled.
Mirrors the mysql-elasticsearch profile shape (sequential + parallel executions)
so every test that runs without the cache also runs WITH the cache. Catches
cache-correctness regressions across the whole codebase, not just the dedicated
cache/* test classes.

Locally, target only cache/* with `-Dit.test='**/cache/*IT'` on top of this
profile when validating cache layer changes in isolation.
-->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven.failsafe.version}</version>
<executions>
<!-- Run sequential tests -->
<execution>
<id>cache-correctness-tests</id>
<id>sequential-tests</id>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
<argLine>-Xmx2048m -XX:+UseG1GC</argLine>
<argLine>-Xmx4096m -XX:+UseG1GC</argLine>
<includes>
<include>**/cache/*IT.java</include>
<include>**/TagRecognizerFeedbackIT.java</include>
<include>**/WorkflowDefinitionResourceIT.java</include>
<include>**/AppsResourceIT.java</include>
<include>**/SystemResourceIT.java</include>
<include>**/VectorEmbeddingIntegrationIT.java</include>
<include>**/PatchTableEmbeddingIT.java</include>
<include>**/GlossaryOntologyExportIT.java</include>
</includes>
<systemPropertyVariables>
<databaseType>postgres</databaseType>
Expand All @@ -836,6 +854,46 @@
<useFile>true</useFile>
</configuration>
</execution>
<!-- Run parallel tests -->
<execution>
<id>parallel-tests</id>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
<argLine>-Xmx4096m -XX:+UseG1GC</argLine>
<includes>
<include>**/*IT.java</include>
<include>**/*Test.java</include>
</includes>
<excludes>
<exclude>**/TagRecognizerFeedbackIT.java</exclude>
<exclude>**/WorkflowDefinitionResourceIT.java</exclude>
<exclude>**/AppsResourceIT.java</exclude>
<exclude>**/SystemResourceIT.java</exclude>
<exclude>**/VectorEmbeddingIntegrationIT.java</exclude>
<exclude>**/PatchTableEmbeddingIT.java</exclude>
<exclude>**/GlossaryOntologyExportIT.java</exclude>
</excludes>
<systemPropertyVariables>
<databaseType>postgres</databaseType>
<databaseImage>postgres:16-alpine</databaseImage>
<searchType>elasticsearch</searchType>
<searchImage>docker.elastic.co/elasticsearch/elasticsearch:9.3.0</searchImage>
<cacheProvider>redis</cacheProvider>
<redisImage>redis:7-alpine</redisImage>

<junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
<junit.jupiter.execution.parallel.enabled>true</junit.jupiter.execution.parallel.enabled>
</systemPropertyVariables>
<trimStackTrace>false</trimStackTrace>
<reportFormat>plain</reportFormat>
<useFile>true</useFile>
</configuration>
</execution>
<!-- Verify phase: Fails the build if any tests failed -->
<execution>
<id>verify</id>
<goals>
Expand Down
Loading
Loading