Repository navigation
Cache improvements: lineage + search layers, observability, CI gate #28012
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
Merged
Merged
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 68614cf
cache: phase 2 ops + correctness — single-flight, slow-read, negative…
harshach a503baa
cache: pipelined mget on CacheProvider + CachedReadBundle.getBatch
harshach a6a6cb9
test(cache): use unique query in sameQueryHitsCacheOnSecondCall to av…
harshach 4148905
cache: drop search cache TTL from 30s to 2s for create-then-search fr…
harshach 9ae7f57
ci: cache-tests profile runs full IT suite + new postgres+es+redis CI…
harshach 3e0effc
fix(cache): address PR review feedback for cache improvements
harshach 72e2cad
fix(cache): only negative-cache on real EntityNotFoundException
harshach db67dfb
fix(cache): copilot review — blank param, javadoc, mget hardening
harshach 5ff45c5
fix(cache): mget partial timeout must trip the circuit breaker
harshach 8fbd0f3
fix(cache): mget shorter critical section + cache/stats + cache/keys doc
harshach 10a29dd
Merge branch 'main' into harshach/redis-cache-perf-check
pmbrull ab808a9
fix(cache): copilot review pass 3 — hot-path L1 check + lineage hash …
harshach b338c8f
fix(cache): lineage hash TTL claimed only by first writer (EXPIRE NX)
harshach 3c1dffa
fix(cache): mget unavailable-path alignment + lineage deser fallback
harshach aaa6612
fix(cache): expireIfAbsent falls back to plain EXPIRE on NX failure
harshach 7972624
fix(cache): copilot review pass 5 — dedicated mget conn + breaker + I…
harshach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
178 changes: 178 additions & 0 deletions
178
.github/workflows/integration-tests-postgres-elasticsearch-redis.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: mvn -DskipTests clean install -pl :openmetadata-integration-tests -am | ||
|
|
||
| - name: Free build artifacts | ||
|
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 | ||
|
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' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.