singhpk234 commented on code in PR #2762:
URL: https://github.com/apache/polaris/pull/2762#discussion_r2408990018
##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java:
##########
@@ -154,6 +159,19 @@ public synchronized Map<String, PrincipalSecretsResult>
bootstrapRealms(
RealmContext realmContext = () -> realm;
if (!metaStoreManagerMap.containsKey(realm)) {
DatasourceOperations datasourceOperations = getDatasourceOperations();
+ int schemaVersion =
+ JdbcBasePersistenceImpl.loadSchemaVersion(
+ datasourceOperations,
+ configurationStore.getConfiguration(
+ realmContext,
BehaviorChangeConfiguration.SCHEMA_VERSION_FALL_BACK_ON_DNE));
+ // skip validation if no schema is specified.
+ int requestedSchemaVersion = getSchemaVersion(bootstrapOptions);
+ Preconditions.checkState(
+ (requestedSchemaVersion == schemaVersion)
+ || (schemaVersion == 0 || requestedSchemaVersion == -1),
Review Comment:
> If the metastore is already bootstrapped with any schema version,
shouldn't bootstrapping fail
our sql scripts are create if not exists kind of sql so when we lets say one
bootstrap a new realm when there are already bootstraped with lower version but
now when its ran with like another version, it just bump the schema to upgraded
version without doing anything like for example some realms in v1 and new realm
to added in v2, hence this handling, am i missing something ?
--
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]