task(ESMappingApiImpl integration) Refs:34933 #35130
task(ESMappingApiImpl integration) Refs:34933 #35130fabrizzio-dotCMS wants to merge 6 commits intomainfrom
Conversation
|
Claude finished @fabrizzio-dotCMS's task in 5m 26s —— View job PR Review
Critical Issues1. OS never switches over after full reindex
The same pattern exists in 2.
return router.readProvider().getIndexDocumentCount(
indexAPI.getNameWithClusterIDPrefix(indexName));
Significant Issues3. Async reindex (ReindexThread/BulkProcessor) only writes to read provider
4. The removed code ( BulkRequest bulkRequest = indexAPI.createBulkRequest();
bulkRequest.timeout(TimeValue.timeValueMillis(INDEX_OPERATIONS_TIMEOUT_IN_MS));The replacement uses Medium Issues5.
6. OS version hardcoded to
7. Silent default port change: 9200 → 9201
Minor Issues8. Stale javadoc reference
9.
10. OSGi rollback risk remains As noted in the prior comment — SummaryThe vendor-neutral abstraction pattern ( |
|
Pull Request Unsafe to Rollback!!!
|
## Summary Registers `OpenSearchUpgradeSuite` as a dedicated CI test matrix entry so it runs automatically with the OpenSearch 3.x upgrade container activated. Also includes minor code-quality cleanup in `ESContentletAPIImpl`. This is the CI companion to #35130, which contains the actual test suite implementation. ## Changes **CI — `.github/test-matrix.yml`** - Added `Integration Tests - OpenSearch Upgrade Suite` suite entry under `integration` - Overrides `base_maven_args` with `-Dopensearch.upgrade.test=true`, which activates the `opensearch-upgrade` Maven profile — that profile starts the OpenSearch 3.x Docker container on port 9201 and restricts Failsafe to run only `OpenSearchUpgradeSuite` - Fixed a trailing whitespace in the existing `base_maven_args` block **Backend — `ESContentletAPIImpl`** - `categories.size() < 1` → `categories.isEmpty()` - `StringBuffer` → `StringBuilder` (non-synchronized context) - String concatenation inside loop → `StringBuilder.append()` chain ## Testing The suite itself (`OpenSearchUpgradeSuite.java` and its member tests) lives in the companion PR #35130 and must be merged before this CI entry is exercisable end-to-end. To verify the matrix entry locally: ```bash # Requires the opensearch-upgrade profile in dotcms-integration/pom.xml ./mvnw verify -pl :dotcms-integration \ -Dcoreit.test.skip=false \ -Dopensearch.upgrade.test=true ``` The profile starts an OpenSearch 3.x container on port 9201 and limits Failsafe to `OpenSearchUpgradeSuite`. ## Breaking Changes **None.** This PR fixes: #35131
Summary
Refactors
ContentletIndexAPIandContentletIndexAPIImplto be vendor-neutral, removing all Elasticsearch SDK types (BulkRequest,BulkProcessor,BulkResponse) from method signatures and replacing them with library-agnostic domain types (IndexBulkRequest,IndexBulkProcessor,IndexBulkListener).ContentletIndexAPIImplis reimplemented as a phase-aware router that delegates to both ES and OS backends based on the current migration phase, enabling dual-write during the ES → OpenSearch migration.Changes
Backend —
ContentletIndexAPIinterfaceorg.elasticsearch.*imports from the public interfaceBulkRequest/BulkProcessor/BulkResponse/ActionListenerwith neutral domain types:IndexBulkRequest,IndexBulkProcessor,IndexBulkListenerfullReindexStart()return type fromStringtoInitIndexInfo(carries timestamp + index names)DateTimeFormatter threadSafeTimestampFormatterand deprecatedSimpleDateFormat timestampFormatter(forRemoval = true)@IndexLibraryIndependentBackend —
ContentletIndexAPIImpl(major refactor)PhaseRouter<ContentletIndexOperations>+operationsES/operationsOSfields for phase-aware routing:[ES][ES, OS][ES, OS][OS]operationsESandoperationsOSfor unit testingContentletIndexAPIImpl → ESMappingAPIImpl → ... → ContentletIndexAPIImpl) via lazyAtomicReference<ContentMappingAPI>loadProviderIndices()to resolve ES/OS physical index names (ES fromIndiciesAPI, OS fromVersionedIndicesAPI)IndexStartupValidator— validates index state at startupBackend — supporting classes
BulkProcessorListener→ adapted toIndexBulkRequest/IndexBulkProcessorReindexThread→ updated callers to neutral APIIndexAPIImpl→ minor correctness fixesPermissionBitFactoryImpl→ removed 10 lines of dead codePhaseRouter→ minor additions;InitIndexInfo/ConfigurableOpenSearchProvider/OSIndexAPIImpl→ minor fixesInfrastructure
docker/docker-compose-examples/single-node-os-migration/docker-compose.yml— runs ES 7.9.1 + OpenSearch 3.4.0 side-by-side with dotCMS for local migration validationTests
ContentletIndexAPIImplTestandESSiteSearchAPITestupdated to compile against the new neutral API signatures (no new test coverage added)Testing
No new integration tests are added in this PR (they live in the companion PR #35133).
To verify locally:
Confirm that:
ContentletIndexAPIImplinstantiates without circular dependency errorsContentletIndexAPIlayerBreaking Changes
ContentletIndexAPImethod signatures changed:fullReindexStart()StringInitIndexInfoputToIndex(...)BulkRequest,ActionListener<BulkResponse>IndexBulkRequestcreateBulkRequest(...)BulkRequestIndexBulkRequestappendBulkRequest(...)BulkRequestIndexBulkRequestappendBulkRemoveRequest(...)BulkRequestIndexBulkRequestcreateBulkProcessor(...)BulkProcessorIndexBulkProcessorappendToBulkProcessor(...)BulkProcessorIndexBulkProcessorAny class directly implementing or calling these methods outside of
ContentletIndexAPIImplmust be updated to use the neutral domain types.This PR fixes: #34933