-
-
Notifications
You must be signed in to change notification settings - Fork 555
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
XWIKI-22613: Updating the history can take a very long time when there are a lot of objects #3788
Conversation
e6629fe
to
4e62720
Compare
f7ebb8d
to
aa16eef
Compare
844f05d
to
1940f27
Compare
…e are a lot of objects XWIKI-22752: Allows indicating in the Hibernate hbm configuration files that an entity should be compressed XWIKI-22747: Introduce the concept of XWiki Hibernate adapter
1940f27
to
07ce23a
Compare
int nodesPerFull = context.getWiki() == null ? 5 | ||
: Integer.parseInt(context.getWiki().getConfig().getProperty("xwiki.store.rcs.nodesPerFull", "5")); | ||
int nodesPerFull = context.getWiki() == null ? 1 | ||
: Integer.parseInt(context.getWiki().getConfig().getProperty("xwiki.store.rcs.nodesPerFull", "1")); |
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.
Wondering if it's not the right moment to also put and document that config option in xwiki.cfg? AFAIR it's not at all documented?
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 thought about it, but my feeling is more that we want to bury that option as deep as possible and eventually completely remove that concept.
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.
well, I understand but on the other hand you'll indicate in the RN that this breaking change might be reverted with the same property... maybe it's cleaner if we document all of it in xwiki.cfg indicating values, that it's possible to change it but it's not advised to do it and it's even considered as a deprecated property?
eventually completely remove that concept.
I guess if we start documenting it as a way to revert the old behaviour it makes complicated to also open a proposal for removing it, at least not before 19.x to have a full LTS cycle
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.
that this breaking change
I'm not sure how this is breaking, it just stores a full version every 1 version instead of every 5 versions by default. This does not change the format in any way (i.e. you could still read this database with a previous version of XWiki just fine).
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.
indeed not a breaking change but I assumed when reading your forum proposal that you were going to document the possibility to revert this behaviour, and so this property.
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.
+1 to see it documented
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 do plan to indicate a way to go back to the previous behavior in the release note retro compatibility section, but I would really prefer to keep this option hidden in general, since the goal is really not for users to start using something we would like to get rid of one day.
...ki-platform-oldcore/src/main/java/org/xwiki/store/hibernate/DatabaseProductNameResolved.java
Outdated
Show resolved
Hide resolved
...ki-platform-oldcore/src/main/java/org/xwiki/store/hibernate/DatabaseProductNameResolved.java
Outdated
Show resolved
Hide resolved
...rm-core/xwiki-platform-oldcore/src/main/java/org/xwiki/store/hibernate/HibernateAdapter.java
Show resolved
Hide resolved
...ki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/store/hibernate/HibernateStore.java
Show resolved
Hide resolved
.../xwiki-platform-oldcore/src/main/java/org/xwiki/store/hibernate/HibernateAdapterFactory.java
Show resolved
Hide resolved
.../xwiki-platform-oldcore/src/main/java/org/xwiki/store/hibernate/HibernateAdapterFactory.java
Show resolved
Hide resolved
...oldcore/src/main/java/org/xwiki/store/hibernate/internal/DefaultHibernateAdapterFactory.java
Outdated
Show resolved
Hide resolved
...oldcore/src/main/java/org/xwiki/store/hibernate/internal/DefaultHibernateAdapterFactory.java
Outdated
Show resolved
Hide resolved
...ki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/store/hibernate/HibernateStore.java
Show resolved
Hide resolved
...ki-platform-store/xwiki-platform-store-api/src/main/java/org/xwiki/store/StoreException.java
Show resolved
Hide resolved
* fix various typos * missing `@Unstable` * try to make the design more clear though some renames, examples and javadoc
...xwiki-platform-oldcore/src/main/java/org/xwiki/store/hibernate/AbstractHibernateAdapter.java
Show resolved
Hide resolved
...ki-platform-oldcore/src/main/java/org/xwiki/store/hibernate/DatabaseProductNameResolver.java
Show resolved
Hide resolved
...rm-core/xwiki-platform-oldcore/src/main/java/org/xwiki/store/hibernate/HibernateAdapter.java
Show resolved
Hide resolved
...m-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateBaseStore.java
Show resolved
Hide resolved
...dcore/src/main/java/org/xwiki/store/hibernate/internal/IDVersionHibernateAdapterFactory.java
Show resolved
Hide resolved
...dcore/src/main/java/org/xwiki/store/hibernate/internal/IDVersionHibernateAdapterFactory.java
Show resolved
Hide resolved
...xwiki-platform-oldcore/src/main/java/org/xwiki/store/hibernate/AbstractHibernateAdapter.java
Show resolved
Hide resolved
...ki-platform-oldcore/src/main/java/org/xwiki/store/hibernate/DatabaseProductNameResolver.java
Outdated
Show resolved
Hide resolved
* fix typo * add missing `@Unstable`
* add unit tests
* introduce a configuration to control if compression is enabled or not and disable it for Oracle by default (because the feature is not enabled by default)
...xwiki-platform-oldcore/src/main/java/org/xwiki/store/hibernate/AbstractHibernateAdapter.java
Outdated
Show resolved
Hide resolved
...platform-oldcore/src/main/java/org/xwiki/store/hibernate/internal/MySQLHibernateAdapter.java
Outdated
Show resolved
Hide resolved
* codestyle Co-authored-by: Manuel Leduc <[email protected]>
* no reason to make it public
@@ -304,6 +304,10 @@ jdbc:hsqldb:file:${environment.permanentDirectory}/database/xwiki_db;shutdown=tr | |||
<property name="hibernate.connection.useUnicode">true</property> | |||
<property name="hibernate.connection.characterEncoding">utf8</property> | |||
<!-- To enable if basic compression feature is enabled in Oracle | |||
<property name="xwiki.compressionAllowed">true</property> | |||
--> |
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.
Hmmm this comment is not good, it's already inside another comment so it's breaking the file. Going to fix this.
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.
Indeed, did not notice. Problem is that it's not that easy to fix, ideally when you uncomment the Oracle section, this part should be commented.
All I can think of right now is either:
- remove that property from the file entirely, and just document how to enable compression for Oracle on https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationOracle
- or move this commented property to a more generic location and indicate in the comment its default behavior for the various supported databases
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 actually chose to always put the property but with a false value, and add the info in the notes, see: 72e10a1. Should work, no?
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 commented your change, IMO this is a bad idea.
…e are a lot of objects (xwiki#3788) XWIKI-22752: Allows indicating in the Hibernate hbm configuration files that an entity should be compressed XWIKI-22747: Introduce the concept of XWiki Hibernate adapter
Jira URL
https://jira.xwiki.org/browse/XWIKI-22613: Updating the history can take a very long time when there are a lot of objects
https://jira.xwiki.org/browse/XWIKI-22752: Allows indicating in the Hibernate hbm configuration files that an entity should be compressed
https://jira.xwiki.org/browse/XWIKI-22747: Introduce the concept of XWiki Hibernate adapter
Changes
Description
The main goal of this change is to stop storing diff in the document history table.
The "stop storing diff" part is easy, but it implies trying to optimize the RCS table to try to reduce its size as much as possible by compressing it. Since the way to do this is not handled by Hibernate and quite different depending on the database engine, I also used this opportunity to improve how we deal with the difference between database engines with a new HibernateAdapater concept.
Clarifications
See the following for more details and discussion around each subject:
HibernateAdapter
API: https://forum.xwiki.org/t/new-xwiki-api-to-extend-the-hibernate-dialects/16193Executed Tests
New tests:
The main goal of this pull request is improving document save performances, which is not something which is easy to accurately test in an integration test.
Expected merging strategy