You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Stefan Egli (Jira)" <ji...@apache.org> on 2020/07/16 10:02:00 UTC
[jira] [Resolved] (OAK-9130)
DocumentDiscoveryLiteService.hasBacklog logging regression (inverted
version check)
[ https://issues.apache.org/jira/browse/OAK-9130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefan Egli resolved OAK-9130.
------------------------------
Fix Version/s: 1.34.0
Resolution: Fixed
* Fixed in [trunk, rev 1879936 (for 1.34.0)|http://svn.apache.org/viewvc?rev=1879936&view=rev]
> DocumentDiscoveryLiteService.hasBacklog logging regression (inverted version check)
> -----------------------------------------------------------------------------------
>
> Key: OAK-9130
> URL: https://issues.apache.org/jira/browse/OAK-9130
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: documentmk
> Affects Versions: 1.8.13, 1.22.0, 1.32.0
> Reporter: Stefan Egli
> Assignee: Stefan Egli
> Priority: Major
> Fix For: 1.34.0
>
> Attachments: OAK-9130.patch.v0.txt
>
>
> It looks like OAK-8139 has introduced a regression in the version check logic of DocumentDiscoveryLiteService.hasBacklog :
> [Before the change|https://github.com/apache/jackrabbit-oak/blame/65f45f7c11d52f76e72645df968f16e4f990fea0/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentDiscoveryLiteService.java#L514] the logic was:
> {noformat}
> Version actual = Version.parseVersion((String) oakVersion);
> Version introduced = Version.parseVersion("1.3.5");
> if (actual.compareTo(introduced)>=0) {
> warn = true;
> }
> {noformat}
> [After the change|https://github.com/apache/jackrabbit-oak/blob/jackrabbit-oak-1.10.6/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentDiscoveryLiteService.java#L514] the logis is:
> {noformat}
> warn = versionPredates("1.3.5", (String) oakVersion);
> {noformat}
> with {{versionPredates}} logic as follows:
> {noformat}
> static boolean versionPredates(String base, String compare) {
> Version one = Version.parseVersion(substSnapshotPrefix(compare));
> Version two = Version.parseVersion(substSnapshotPrefix(base));
> return two.compareTo(one) > 0;
> }
> {noformat}
> The behaviour of {{versionPredates}} can eg. be easily seen in the test:
> {noformat}
> assertTrue(DocumentDiscoveryLiteService.versionPredates("1.3.5", "1.0.0"));
> {noformat}
> So before the change the log.warn would be issued for versions *newer or equal* to 1.3.5, where as after the change the log.warn is issued for versions *lower* than 1.3.5.
> This inverts only the log.warn filtering with no other side-effects.
> /cc [~reschke]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)