New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-create Elasticsearch schema on startup in tests/dev mode with Hibernate Search and Elasticsearch dev services #26186
Re-create Elasticsearch schema on startup in tests/dev mode with Hibernate Search and Elasticsearch dev services #26186
Conversation
79d8867
to
2f94145
Compare
9041d1b
to
8a65777
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a couple of small comments/questions. Nothing big.
...kus/hibernate/search/orm/elasticsearch/deployment/HibernateSearchElasticsearchProcessor.java
Outdated
Show resolved
Hide resolved
devServicesAdditionalConfigProducer | ||
.produce(new DevServicesAdditionalConfigBuildItem(propertyKeyIndicatingHostsConfigured, | ||
schemaManagementStrategyPropertyKey, forcedValue, | ||
() -> LOG.infof("Setting %s=%s to initialize Dev Services managed Elasticsearch server", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the INFO here. We usually try to avoid verbosity. I don't have a very strong opinion on it but it might be a bit cumbersome if it's the new normal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's consistent with what we do for databases in the ORM extension.
It appears only in dev mode, and before we even display the banner (somewhere around the stuff about docker containers), so I feel it's fine.
But if you want, I can open a ticket and I'll handle that for Hibernate ORM, Hibernate Search, and any other extension that does something like this (I don't think there is any, but I'll check).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. Let's leave it at that for now.
...arch/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfigPersistenceUnit.java
Outdated
Show resolved
Hide resolved
...arch/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfigPersistenceUnit.java
Outdated
Show resolved
Hide resolved
...arch/orm/elasticsearch/runtime/HibernateSearchElasticsearchRuntimeConfigPersistenceUnit.java
Outdated
Show resolved
Hide resolved
…rnate Search and Elasticsearch dev services
…ty keys in Hibernate Search extension
Thanks! I definitely need to get "Dev Services" right, next time... Anyway, I addressed your comments. |
8a65777
to
b0fd4fb
Compare
Fixes #24923
Supersedes #26175
As explained in #24923, the "validation on startup" feature doesn't make sense here, but dropping and re-creating indexes on startup when using dev services does make sense, especially for tests.
This simplifies configuration:
quarkus.hibernate-orm.database.generation = drop-and-create
for tests / dev modequarkus.hibernate-search-orm.schema-management.strategy = drop-and-create-and-drop
for tests / dev mode(Ok it's not that much simpler, but more PRs are coming)
Creating as draft, because this PR is based on #26184 , which must be merged first.=> Done