Hey Steffen, I took a quick look at the backup/restore codepath involved here - surprisingly the restore code itself hasn't changed between 8.6.3 and 8.8.2. In both 8.6.3 and 8.8.2, if the configset mentioned in the backup has the same name as a config currently in ZooKeeper, the version in ZK is used. So fields added to the schema after the backup _should_ be visible. Obviously per your report this isn't happening though. To me that says that there must be some change of behavior in collection-creation or in schema-reading.
I'm hoping to do a bit more digging to get to the bottom of this. In the meantime, would you mind filing a JIRA ticket regarding this behavior (if you haven't already)? One last question: you mentioned above that the field becomes visible after a restart - does a reload (/admin/collections?action=RELOAD&name=testcollection) have the same effect? If so that may be a more palatable work-around for you in the short-term... Best, Jason On Thu, Jun 3, 2021 at 9:32 AM Steffen Moldenhauer <[email protected]> wrote: > > we tried to upgrade from 8.6.3 to 8.8 but had trouble with collection restore > and schema changes. > If there were changes to the schema - they are not visible in the Schema API. > We are using the backup/restore to transfer pre-built collections to > production systems and this issue prevents us from using the latest version > 8.8.2 > > These are the basic steps to reproduce the issue on a "solr start -c" : > > For preparation create a config set, collection and backup: > http://localhost:8983/solr/admin/configs?action=CREATE&name=testcollection&baseConfigSet=_default > http://localhost:8983/solr/admin/collections?action=CREATE&collection.configName=testcollection&name=testcollection&numShards=1 > http://localhost:8983/solr/admin/collections?action=BACKUP&location=/var/solr_backup&name=testcollection_backup&collection=testcollection > > Check the list of fields with the schema API: > http://localhost:8983/solr/testcollection/schema/fields > Note the fields listed. > > Simulate a schema change - add a field "test1"to the managed-schema: > /var/solr_backup/testcollection_backup/zk_backup/configs/testcollection/managed-schema > <field name="test1" type="string" indexed="true" stored="true" /> > > Delete the collection and config set and restore it from the backup: > http://localhost:8983/solr/admin/collections?action=DELETE&name=testcollection > http://localhost:8983/solr/admin/configs?action=DELETE&name=testcollection > http://localhost:8983/solr/admin/collections?action=RESTORE&location=/var/solr_backup&name=testcollection_backup&collection=testcollection > > Check the list of fields with the schema API again: > http://localhost:8983/solr/testcollection/schema/fields > The added test1 field is missing. > > The field is immediately visible in 8.6.3 In 8.8.2 a server restart is > necessary to see the new field. > Is this a known issue? > > Regards > Steffen Moldenhauer
