On Wed, 3 Jan 2024 at 16:59, Thorsten Behrens <t...@libreoffice.org> wrote: > > Source: clucene-core > Followup-For: Bug #1059805 > X-Debbugs-Cc: r...@debian.org, t...@libreoffice.org > > James Addison wrote: > > And so a question: could the fix be achieved by changing the default > > value of the version field from millis-timestamp to zero -- meaning: > > without needing to adjust the API? > > > Note that we _only_ need this during build time (so another option > would be using the custom clucene during build, but still link the > system clucene for runtime). > > I simply don't know enough about the motivations to have this > pseudo-random value there in the first place, to opine on whether the > default can/should be changed...
Agreed. I'm trying to trace the origins of that behaviour. There's a thread at LUENE-3606 (ref[0]) that seems relevant, and I've included a few notes below from scouring through some git history. Notes: This timestamping was introduced[1] in Lucene 1.9RC1 back in Y2005 - the changelog entry[2] doesn't tell us much more, although we can imply that it was for a timing/refreshness related fix, because the change adds an isCurrent method (described as useful to check whether an IndexReader has an up-to-date object reference to an index/segment) and test coverage. There is a subsequent race-condition fixup[3]. At Lucene v4.x, the field returned to being a zero-initialized counter[4]. That change[5] was made for LUCENE-3672 (ref[6]). However: the clucene-core/2.3.3.4 package currently in Debian is currently based on Lucene v2.3.2 - so that's the version to maintain compatibility with. This[7] comment makes me think that resettng to zero isn't entirely unrealistic. [0] - https://issues.apache.org/jira/browse/LUCENE-3607 [1] - https://github.com/apache/lucene/commit/c636897dc4a8a333295792718548bb50e9ab87ec [2] - https://github.com/apache/lucene/commit/6455d1a1061f85c9ae7837967370b43bc1add4a1 [3] - https://github.com/apache/lucene/commit/9a9da2f7703ead41fd5f21f146d77aaddd4a76a0 [4] - https://github.com/apache/lucene/blob/30b22298bacb5238437864128bc9005d49d0d3ed/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java#L131-L132 [5] - https://github.com/apache/lucene/blob/30b22298bacb5238437864128bc9005d49d0d3ed/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java#L131-L132 [6] - https://issues.apache.org/jira/browse/LUCENE-3672 [7] - https://issues.apache.org/jira/browse/LUCENE-3607?focusedCommentId=13159392&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-13159392