You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Shibi-bala (via GitHub)" <gi...@apache.org> on 2023/10/09 04:48:47 UTC
[I] segmentInfos.replace() doesn't set userData [lucene]
Shibi-bala opened a new issue, #12637:
URL: https://github.com/apache/lucene/issues/12637
### Description
Found that the [replace method](https://github.com/qcri/solr-6/blob/master/lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java#L875-L878) doesn't set `userData` with the new user data from `other`. Unsure if this is an oversight, but if it is, I have a PR up [here
](https://github.com/apache/lucene/pull/12626).
Existing:
```
void replace(SegmentInfos other) {
rollbackSegmentInfos(other.asList());
lastGeneration = other.lastGeneration;
}
```
Fix:
```
void replace(SegmentInfos other) {
rollbackSegmentInfos(other.asList());
lastGeneration = other.lastGeneration;
userData = other.userData;
}
```
### Version and environment details
Lucene version 9.7
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] segmentInfos.replace() doesn't set userData [lucene]
Posted by "Shibi-bala (via GitHub)" <gi...@apache.org>.
Shibi-bala commented on issue #12637:
URL: https://github.com/apache/lucene/issues/12637#issuecomment-1763086904
Yeah exactly. I'd say `userData` isn't metadata so it should get replaced as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] segmentInfos.replace() doesn't set userData [lucene]
Posted by "Shibi-bala (via GitHub)" <gi...@apache.org>.
Shibi-bala commented on issue #12637:
URL: https://github.com/apache/lucene/issues/12637#issuecomment-1763742706
@msfroh this impacts the ability to snapshot since you can't read old `userData`. Check out the test in my PR: https://github.com/apache/lucene/pull/12626
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] segmentInfos.replace() doesn't set userData [lucene]
Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler closed issue #12637: segmentInfos.replace() doesn't set userData
URL: https://github.com/apache/lucene/issues/12637
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [I] segmentInfos.replace() doesn't set userData [lucene]
Posted by "msfroh (via GitHub)" <gi...@apache.org>.
msfroh commented on issue #12637:
URL: https://github.com/apache/lucene/issues/12637#issuecomment-1763041651
I was curious about this one, and whether it is a bug or intentional.
I noticed that the `IndexWriter` constructor that calls `SegmentInfos.replace()` has a comment saying:
````
// Swap out all segments, but, keep metadata in
// SegmentInfos, like version & generation, to
// preserve write-once. This is important if
// readers are open against the future commit
// points.
```
I suppose the `userData` isn't metadata, so you might expect it to be replaced too.
Also, `replace` is called when we have explicitly said that we want to load an earlier commit when initializing the `IndexWriter`. Part of that earlier commit is its `userData`, right?
tl;dr: Yeah -- this sounds like something that got missed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org