You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by "sivakumar-mahalingam (via GitHub)" <gi...@apache.org> on 2026/10/22 08:05:42 UTC
[PR] [AMORO-4462][AMS] Publish overview top-table cache atomically [amoro]
sivakumar-mahalingam opened a new pull request, #4463:
URL: https://github.com/apache/amoro/pull/4463
## Why are the changes needed?
`OverviewManager` stores the top-table cache in a shared mutable `ArrayList`. The background refresh thread updates this list using separate `clear()` and `addAll()` operations while HTTP request threads may read it.
As a result, a request can observe an empty or inconsistent intermediate cache state during a refresh. The cache should instead publish complete snapshots atomically so readers always receive either the previous snapshot or the newly refreshed snapshot.
Close #4462.
## Brief change log
- Replace the mutable top-table cache with a volatile immutable snapshot.
- Build the complete snapshot before publishing it with a single assignment.
- Return the published immutable snapshot directly to readers.
- Add a regression test covering snapshot immutability and replacement during refresh.
## How was this patch tested?
- [x] Added a regression test in `TestOverviewManager` that verifies the snapshot remains stable between refreshes and is replaced after a refresh.
- [x] Screenshots are not applicable because this change does not affect the UI.
- [x] Ran the targeted test locally:
```shell
./mvnw -pl amoro-ams -am -Pskip-dashboard-build \
-Dtest=TestOverviewManager \
-Dsurefire.failIfNoSpecifiedTests=false test
```
Result: 2 tests passed with no failures, errors, or skips.
- [x] Ran repository validation locally:
```shell
./mvnw validate
```
Result: all 33 modules passed Spotless and Checkstyle validation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org