Issue Details (XML | Word | Printable)

Key: XWIKI-1459
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Artem Melentev
Reporter: Artem Melentev
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
XWiki Core

keep document history in a separate table

Created: 06/Jul/07 12:30   Updated: 17/Aug/07 15:53  Due: 19/Jul/07
Component/s: Core, Storage
Affects Version/s: 1.1 M2
Fix Version/s: 1.2 M1

File Attachments: 1. Java Archive File jrcs.diff-0.4.1-xwiki.jar (24 kB)
2. Java Archive File jrcs.diff-0.4.2.jar (24 kB)
3. Java Archive File jrcs.rcs-0.4.1-xwiki.jar (61 kB)
4. Java Archive File jrcs.rcs-0.4.2.jar (61 kB)
5. Zip Archive testrcs.zip (13 kB)
6. Zip Archive XWIKI-1459-2-r2.patch.zip (17 kB)
7. Text File XWIKI-1459-r3.patch (99 kB)
8. Text File XWIKI-1459-r4.patch (112 kB)
9. Text File XWIKI-1459-r5.patch (134 kB)
10. Text File xwiki-platform-core-1459-r0.patch (32 kB)

Environment: JRCS
Issue Links:
Dependency

keywords: store,history,DBImprovement,soc
Date of First Response: 24/Jul/07 23:22
Resolution Date: 17/Aug/07 15:53


 Description  « Hide
email thread: http://www.nabble.com/-Proposal--Document-history-storage-tf3310594.html#a9209023

I see 2 solutions:

1. Continue using jrcs.Archive and extend and storing jrcs.Nodes
But jrcs isn't look easy extendable

2. Use only jrcs.Diff and do remains by self.
As Sergiu propose.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Artem Melentev added a comment - 09/Jul/07 14:55
I start to implement solution #2

Artem Melentev added a comment - 11/Jul/07 13:35
Attached preview implementation of solution #1. It is not usable now, because don't add new features. Just save/load diffs separately in table xwikircs.
Requires new JRCS 4.1 from www.suigeneris.org/jrcs/

Artem Melentev added a comment - 16/Jul/07 15:42
Attached test implementation of solution #2: "testrcs.zip". XWiki-like code environment.
I plan to rewrite this implementation for real xwiki sourcecode.

Artem Melentev added a comment - 18/Jul/07 12:34
Attached implementation of solution #2. XWIKI-1459-2-r2.patch.zip
Major rewrite of versioning system. Fetch diff content by demand. Minor edit feature.
I would like to get some feedback before to commit it

Artem Melentev added a comment - 24/Jul/07 21:37
Attached JRCS-0.4.1-xwiki with major but primitive JRCS-23 bug fix.
It need to be uploaded to our xwiki-externals repository for this issue.

Artem Melentev added a comment - 24/Jul/07 22:33
Attached XWIKI-1459-r3.patch - new revision of solution #2
Some bugs fixed, some code refactored.
Added api.RevisionInfo for getting information about document version, which used in XWIKI-1447
Tested on hsqldb, mysql, pgsql, derby.
Ready to commit.

Sergiu Dumitriu added a comment - 24/Jul/07 23:22
Hi Artem,

Sorry for not being such a good mentor until now, but I also had some stuff to take care of.

I'll look at the patch tomorrow.


Artem Melentev added a comment - 27/Jul/07 22:04
Attached XWIKI-1459-r4.patch - 4st revision of solution #2

Added possibility to store full xml version instead of diff.
By default full version storing per 4 diff (smal for debuging yet).
xwiki.cfg configure option xwiki.store.rcs.nodesPerFull to configure this value.
It is safe to change this parameter in any time.

Applied coding style to new files and some modified



Attached XWIKI-1459-r5.patch - 5st revision of issue solution
+ XWikiPatch class for easy migrate to future XWikiPatch system. (now contain one diff field)
+ remove versions feature (XWIKI-962)
some refactors.
All major features of new history storage are done, so api & code is quite stable.
May I commit this?

Sergiu Dumitriu added a comment - 02/Aug/07 18:40
Hi Artem,

I started looking at the code, and it looks good. Wait just a bit until I take another look when I'm not as asleep.


Sergiu Dumitriu added a comment - 07/Aug/07 02:06
The patch is good, you can commit it.

Vincent Massol added a comment - 07/Aug/07 22:16
JRCS 0.4.2 has been uploaded to XWiki' s custom repo.

Artem Melentev added a comment - 07/Aug/07 23:13
fixed in r4119

Artem Melentev added a comment - 07/Aug/07 23:18
xwiki need import&export to save old history while update. This should be included in 1.1M4 release notes.

Vincent Massol added a comment - 08/Aug/07 08:57
Artem, I noticed a method named "getUpdeteNodeContents". I guess it should be getUpdatedNodeContents()?

Vincent Massol added a comment - 08/Aug/07 08:59
Re the import/export this is not going to be easy for all 0.9 users as there was no export at that time. Also, when you have a medium size wiki you cannot use import/exports as there's never enough RAM to hold the whole wiki in memory....

I think we need to offer something different too, maybe a sql script. WDYT?


Vincent Massol added a comment - 08/Aug/07 09:25
Some superficial comments:
  • Are you sure about this comment:
+        // there is no version in doc yet, so 1.1
+        assertEquals("1", this.document.getVersion());
  • Also I think we'll need to improve the javadoc as I'm having a hard time to understand what it means in some places. I'll try to fix some when I find them.
  • I have no idea what this is about. The comment makes it almost even harder to understand Could you improve it?
+    // methods for easy table update. because default value == null
+    protected Boolean getMinorEdit1()
+    {
+        return Boolean.valueOf(isMinorEdit);
+    }
+    protected void setMinorEdit1(Boolean isMinor)
+    {
+        isMinorEdit = (isMinor!=null && isMinor.booleanValue());
+    }
  • Variable should be named following typical java conventions: contentref --> contentRef

This is a big patch... There's a high chance it has broken stuff so we need to do some extra testing before we can release 1.1M4...


Artem Melentev added a comment - 08/Aug/07 10:41
reopened.
Vincent, thanks for remarks. I will fix it soon.

Artem Melentev added a comment - 08/Aug/07 11:53
remarks fixed in r4126.
Vincent,
native sql script is unsuitable, because xwiki needs parce rcs archive (via XWikiRCSArchive) and store nodes separately. So xwiki-core is needed.
How do you see sql script? Some external package that migrate data?
I think we need migration system or something inside core and guided via xwiki.cfg for it.

Vincent Massol added a comment - 08/Aug/07 12:12
I don't know how you want to do it but our 0.9 users need to be able to upgrade to 1.1M4. How do they do it?

Thanks
-Vincent


Artem Melentev added a comment - 10/Aug/07 14:09
rollback

Artem Melentev added a comment - 16/Aug/07 00:48
can i unlink XWIKI-1569 as blocks? because this issue depends on it, not blocks

Sergiu Dumitriu added a comment - 16/Aug/07 02:43
Yes, I already did it.

Artem Melentev added a comment - 17/Aug/07 15:53
fixed again in r4361.
added migration for easy update old data.