{"push_id":951774616,"size":1,"distinct_size":1,"ref":"refs/heads/upstream/stable-2.11","head":"a5f2037a42a5275c0581b8b4afcb76db0445ad07","before":"a533b1519c62f99cc0329dac4bb98049df3db6c4","commits":[{"sha":"a5f2037a42a5275c0581b8b4afcb76db0445ad07","author":{"email":"aa743a0aaec8f7d7a1f01442503957f4d7a2d634@ostrovsky.org","name":"David Ostrovsky"},"message":"Expose IndexCollection in plugin guice injector\n\nSecondary index underwent quite some evolution, by adding new fields\nor turning search predicates that (uncorrectly) used database to\nproduce matches to use secondary index. When new index version is\nadded, the previous index version must still be supported because of\nonline reindexing feature. On very big site, reindexing may take hours,\nclearly such a long offline time is non acceptable, that why online\nreindexing feature was invented. To make online reindexing work, schema\nversion must be fetched to route the current search predicate to use\nold (legacy) or new field. For that IndexCollection is accessed and\nthe current schema version is read.\n\nUnfortunately, IndexCollection implements LifecycleListener and these\nclasses are not copied in guice plugin injector when the plugin is\nloaded. This makes secondary index machinery not usable from within a\nplugin listener. For the reasons explained above some search predicates\nwould try to retrieve the secondary index version but because singleton\nIndexCollection instance wasn't made available in plugin's guice\ninjector, the correct instance is not found and guice injector creates\nnew virgin IndexCollection instance where change index (and the schema\nversion) is not set. As the consequence we are getting a NPE when\nsecondary index is tried to be used from within plugin listener.\n\nTo rectify, expose IndexCollection to plugin guice injector.\n\nBug: Issue 3768\nChange-Id: I2f9c40aa43aa7b1b954d8fa318df54e45dffcd95","distinct":true,"url":"https://api.github.com/repos/openstack-infra/gerrit/commits/a5f2037a42a5275c0581b8b4afcb76db0445ad07"}]}