ayushtkn opened a new issue, #4809:
URL: https://github.com/apache/polaris/issues/4809

   ### Describe the bug
   
   Ran this locally
   ```
   ./gradlew :polaris-admin:test --tests '*NoSqlInMemoryBootstrapCommandTest'
   ```
   
   Fails with
   ```
   Caused by: java.lang.IllegalStateException: Cannot build RealmObj, some of 
required attributes are not set [versionToken]
        at 
org.apache.polaris.persistence.nosql.realms.store.ImmutableRealmObj$Builder.build(ImmutableRealmObj.java:921)
        at 
org.apache.polaris.persistence.nosql.realms.store.RealmStoreImpl.lambda$create$5(RealmStoreImpl.java:149)
        at 
org.apache.polaris.persistence.nosql.impl.commits.CommitterImpl.commitAttempt(CommitterImpl.java:433)
        at 
org.apache.polaris.persistence.nosql.impl.commits.CommitterImpl.lambda$commit$0(CommitterImpl.java:126)
        at 
org.apache.polaris.persistence.nosql.impl.commits.retry.RetryLoopImpl.retryLoop(RetryLoopImpl.java:74)
        at 
org.apache.polaris.persistence.nosql.impl.commits.CommitterImpl.commit(CommitterImpl.java:118)
        at 
org.apache.polaris.persistence.nosql.impl.commits.CommitterImpl.commit(CommitterImpl.java:96)
        at 
org.apache.polaris.persistence.nosql.api.commit.Committer.commitRuntimeException(Committer.java:83)
        at 
org.apache.polaris.persistence.nosql.realms.store.RealmStoreImpl.create(RealmStoreImpl.java:124)
        at 
org.apache.polaris.persistence.nosql.realms.store.RealmStoreImpl_ClientProxy.create(Unknown
 Source)
        at 
org.apache.polaris.persistence.nosql.realms.impl.RealmManagementImpl.create(RealmManagementImpl.java:92)
        at 
org.apache.polaris.persistence.nosql.realms.impl.RealmManagementImpl_ClientProxy.create(Unknown
 Source)
        at 
org.apache.polaris.persistence.nosql.metastore.NoSqlMetaStoreManagerFactory.lambda$bootstrapRealm$2(NoSqlMetaStoreManagerFactory.java:254)
        at java.base/java.util.Optional.orElseGet(Optional.java:364)
        at 
org.apache.polaris.persistence.nosql.metastore.NoSqlMetaStoreManagerFactory.bootstrapRealm(NoSqlMetaStoreManagerFactory.java:252)
        at 
org.apache.polaris.persistence.nosql.metastore.NoSqlMetaStoreManagerFactory.bootstrapRealms(NoSqlMetaStoreManagerFactory.java:115)
        at 
org.apache.polaris.persistence.nosql.metastore.NoSqlMetaStoreManagerFactory_ClientProxy.bootstrapRealms(Unknown
 Source)
        at 
org.apache.polaris.core.persistence.AdminToolProducers_ProducerMethod_metaStoreManagerFactory_FlD2ZGSQKpcFeohEk9h2KPnp74o_ClientProxy.bootstrapRealms(Unknown
 Source)
        at 
org.apache.polaris.admintool.PurgeCommandTestBase.preBootstrap(PurgeCommandTestBase.java:55)
        at 
org.apache.polaris.admintool.PurgeCommandTestBase_Observer_preBootstrap_52f0iXCM486TEECxyyaiHjYc900.notify(Unknown
 Source)
   ```
   
   Hypothesis on why?
   
   Commit c6d966d6a — "Migrate persistence/nosql to JSpecify null annotations 
(#4130)"                                                                        
                                 
                                            
     It changed `Obj.versionToken()` from:           
   ```                                                                          
                                                                    
     import jakarta.annotation.Nullable;  // @Target({METHOD, FIELD, PARAMETER, 
TYPE_USE})
   
                                                                                
                                                                                
                                 
     @Nullable                                                                  
                                                                                
                                 
     String versionToken();
   
   ```
                                                                                
                                                                                
                                 
     to:
   ```                                                                          
                                                                                
                               
     import org.jspecify.annotations.Nullable;  // 
@Target(ElementType.TYPE_USE) only
                                                                                
                                                                                
                                 
     @Nullable                                                                  
                                                                                
                                 
     String versionToken();
   
   ```
                                                                                
                                                                                
                                 
     *Why this broke things*: The Immutables annotation processor only 
recognizes `@Nullable` on methods directly declared on the type it's processing 
— not inherited ones. With
     `jakarta.annotation.Nullable` (which has METHOD in its target), Immutables 
could see the nullability even on inherited methods. With 
`org.jspecify.annotations.Nullable `(TYPE_USE only),       
     Immutables no longer recognizes it on inherited `versionToken()`, so the 
generated builders treat it as non-null (required field).
                                                                                
                                                                                
                                 
     *Why CI never caught it*: I guess Gradle's ABI fingerprinting excludes 
TYPE_USE annotations from classpath hash computation. The build cache key for 
downstream modules never changed, so CI keeps    
     serving the old generated Immutable*.class files from before the migration 
— where versionToken was still correctly nullable. This is hypothesis, I am not 
still very sure why it is passing in CI
   
   ### To Reproduce
   
   _No response_
   
   ### Actual Behavior
   
   _No response_
   
   ### Expected Behavior
   
   _No response_
   
   ### Additional context
   
   _No response_
   
   ### System information
   
   _No response_


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to