Serge Huber created UNOMI-943:
---------------------------------

             Summary: Migration script 3.1.0 correctness: idempotency and null 
resource handling
                 Key: UNOMI-943
                 URL: https://issues.apache.org/jira/browse/UNOMI-943
             Project: Apache Unomi
          Issue Type: Sub-task
          Components: unomi(-core)
    Affects Versions: unomi-3.1.0
            Reporter: Serge Huber
            Assignee: Serge Huber
             Fix For: unomi-3.1.0


Two bugs in the 3.1.0 migration scripts:

*1. {{3.1.0-configure-rollover-aliases}} nested inside 
{{{}3.1.0-get-all-indices{}}}, bypassing idempotency tracking 
({{{}migrate-3.1.0-01-tenantDocumentIds.groovy:152{}}})* The 
alias-configuration step is registered via {{performMigrationStep}} inside the 
lambda of the outer {{get-all-indices}} step. If a migration run fails and is 
resumed after the outer step is already marked complete, the alias step is 
never registered or executed — write aliases for rollover indices are silently 
not configured, causing all subsequent event/session writes to fail. _Fix:_ 
Hoist {{3.1.0-configure-rollover-aliases}} to the top level of the script so it 
is always evaluated and independently tracked.

*2. {{MigrationUtils.getFileWithoutComments}} NPE on missing resource 
({{{}MigrationUtils:78{}}})* The method calls 
{{bundleContext.getBundle().getResource(resource)}} and immediately 
dereferences the returned URL without a null check. If the resource is absent 
(e.g., packaging error), the migration step fails with an unattributed 
{{NullPointerException}} with no indication of which file was missing. _Fix:_ 
Add {{{}if (url == null) throw new RuntimeException("Resource not found: " + 
resource){}}}, matching the pattern already present in {{{}resourceAsString{}}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to