Hello, I have a service that creates and manages Lucene indices. The service is using Lucene 8 and I want to upgrade to Lucene 9, and I would like to be able to rollback the upgrade in case I encounter any issues (*). The problem is that the older version of the service won't be able to read the segments created after the upgrade because they would be created using Lucene 9's codec.
One potential solution is to keep writing new indices using Lucene 8's codecs after upgrading to Lucene 9, and only start using Lucene 9's codec after some time. However this doesn't seem to be officially supported: the lucene-backward-codecs package provides older codecs, but they are read-only. My questions are: 1. I can try copying over the actual codecs from Lucene 8 instead of using lucene-backward-codecs, but is this actually supposed to work, or will there be undefined behaviors when the codec is used with Lucene 9? 2. Is there an alternative solution to support rollbacks? Any help would be greatly appreciated! Best regards, Yixun Xu (*) I'm not really worried about the Lucene upgrade itself, but I have less confidence in the changes I make alongside the upgrade. For example, if I make some changes to my code to address compilation breaks brought by the Lucene upgrade, then I'd like to keep the option to immediately rollback the service in case those changes I made end up causing serious issues.