task(Migrate ESMappingAPIImpl) Refs #34933#35289
task(Migrate ESMappingAPIImpl) Refs #34933#35289fabrizzio-dotCMS wants to merge 6 commits intomainfrom
Conversation
|
Claude finished @fabrizzio-dotCMS's task in 3m 32s —— View job PR Review — task(Migrate ESMappingAPIImpl) Refs #34933
SummaryThe architecture is sound and the phase-routing abstraction is clean. A few concrete issues worth fixing before merge. Issues1. operationsES.putToIndex(dual.esReq); // throws → OS is never called
try {
operationsOS.putToIndex(dual.osReq);
} catch ...If ES throws, the OS shadow write is silently skipped. 2. boolean result = true;
for (final ContentletIndexOperations ops : router.writeProviders()) {
try {
result &= ops.createContentIndex(physicalName, shards); // throws IOException
} catch (Exception e) {
Logger.error(...); // caught — result stays true
}
}
return result; // true, even if OS creation failedWhen The private 3-arg version ( 3. private ProviderIndices loadProviderIndicesQuietly(final ContentletIndexOperations ops) {
return Try.of(() -> loadProviderIndices(ops)).getOrElse((ProviderIndices) null);
}A 4. OSGi breaking changes without backward-compatible shims (already flagged in prior review) The previous analysis is accurate and still applies. To summarize: 5.
6. public int size() {
if(isMigrationComplete() || isReadEnabled()) {
return osReq.size();
}
return esReq.size();
}The comment says "ES is always the authoritative source in dual-write phases," but 7. PR description references non-existent method The "Breaking Changes" section says: "Callers previously using the raw timestamp string must call 8. Redundant boolean conditions in if (isMigrationStarted() || isReadEnabled() || isMigrationComplete()) {
Items that look fine
|
|
Pull Request Unsafe to Rollback!!!
|
…/core into issue-34933-Mapping-Layer
|
Pull Request Unsafe to Rollback!!!
|
Summary
Migrates
ContentletIndexAPIImpl— the central content indexing implementation — to the vendor-neutral Phase-aware router pattern. All Elasticsearch-specific types (BulkRequest,BulkProcessor,ActionListener) are replaced with domain-layer abstractions (IndexBulkRequest,IndexBulkProcessor,IndexBulkListener), enabling dual-write routing to both ES and OS backends during the ES→OS migration without leaking vendor types to callers.Changes
Backend — Core Indexing
ContentletIndexAPI(interface): Removed allorg.elasticsearch.*imports from method signatures; replaced with vendor-neutralIndexBulkRequest,IndexBulkProcessor, andIndexBulkListenerdomain types. Added@IndexLibraryIndependentannotation. ChangedfullReindexStart()return type fromStringtoIndexStartResult. Added thread-safeDateTimeFormatteralongside deprecatedSimpleDateFormat.ContentletIndexAPIImpl: Full rewrite to a phase-aware router:ContentletIndexOperationsinstances (operationsES,operationsOS) and delegates viaPhaseRouter<ContentletIndexOperations>DualIndexBulkRequestinner class fans out synchronous bulk batches to both ES and OS in dual-write phasesCompositeBulkProcessorinner class fans out async bulk processing; OS failures are fire-and-forget (shadow) in phases 1/2, propagating only in phase 3ProviderIndicesinner class resolves working/live/reindex index names per provider, strippingos::vendor tags before passing to the OS clientContentMappingAPIviaAtomicReferenceto break the circular dependency chainorg.elasticsearch.*imports from the implementationIndexTag: New utility for stripping vendor-specific index name prefixes (os::)IndexStartResult: New domain value object replacing the rawStringreturned byfullReindexStart()BulkProcessorListener: Updated to implementIndexBulkListenerinstead of the ES-specific listenerReindexThread: Minor updates to useIndexBulkProcessor/IndexBulkRequestinstead of ES typesMappingHelper: ReplacesESMappingUtilHelperas the vendor-neutral mapping utilityContentletIndexOperationsES/ContentletIndexOperationsOS: Updated to expose the new domain type APIsTesting
ContentletIndexAPIImplTest: Updated to use the new domain types and refactored test constructorsESSiteSearchAPITest,EMAWebInterceptorTest,CleanUpFieldReferencesJobTest: Minor compile fixes following the API changesTesting
just test-integration-ideReindexThreadcompletes without errors in both Phase 0 (ES only) and Phase 1 (dual-write) configurationsBreaking Changes
ContentletIndexAPI.fullReindexStart()now returnsIndexStartResultinstead ofString. Callers previously using the raw timestamp string must call.timestampSuffix()on the result.BulkRequest,BulkProcessor, andActionListener<BulkResponse>removed from theContentletIndexAPIinterface. Any code directly casting or importing these types against the interface will not compile.This PR fixes: #34933