One thing that makes the cutover easier would be using aliases feature in
your Solr cloud.

You have old data in something like collection_2022 and the alias is just
collection. Then new index format with new Solr version goes to
collection_2023 assuming you have the spare space and CPU. Do some testing
then when you’re ready switch over the alias and no changes needed client
side! Eventually you delete _2022 and move on with your life.

I’m not sure if this is a Solr cloud only thing, I don’t think it works
with leader/follower mode, but there’s probably similar principles to apply.

Mike


On Fri, Aug 25, 2023 at 2:23 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Shawn,
>
> On 8/25/23 13:04, Shawn Heisey wrote:
> > On 8/25/23 10:44, Shawn Heisey wrote:
> >> On 8/25/23 10:21, Christopher Schultz wrote:
> >>> I believe we have only used Solr 7 and above. Is there a way to
> >>> confirm without actually /trying/ it?
> >>
> >> There is this very cool endpoint shared by Rahul that I did not know
> >> about:
> >
> > I can confirm that running this shell script will completely clear out
> > the versions:
> >
> > DEL_ALL_QUERY_XML="<delete><query>*:*</query></delete>"
> > SOLR_URL_BASE="${SOLR_SCHEME}://${SOLR_HOST}:${SOLR_PORT}/solr"
> > DOVECOT_SOLR_UPDATE_URL="${SOLR_URL_BASE}/${INDEX_NAME}"
> >
> >    curl -m 2 -f -s \
> >
> > "${DOVECOT_SOLR_UPDATE_URL}/update?commit=true&optimize=true&wt=json" \
> >        -H "Content-Type: text/xml" \
> >        --data-binary "${DEL_ALL_QUERY_XML}"
> >
> > This runs very quickly.  I include optimize=true just to make sure that
> > old segments are actually deleted.  It's probably not required ... I'm
> > just being cautious.
> >
> > I would still recommend a reload or restart after doing that.  Reload is
> > faster and less disruptive than restart.
> >
> > The main reason that I recommend deleting index* directories and
> > reloading the index on reindex is to ensure certain schema changes will
> > work without issue.  In this case, I don't think you're changing the
> > schema.
>
> Indeed, I am not changing the schema.
>
> My re-index process includes an optional delete-all which I believe will
> execute something like what you have above. But I'm neither requesting a
> commit nor an optimize as part of that. I've done this many times and
> still the index (via Luke) says that it's 7.4-or-later.
>
> I'll try to hit the API endpoint you reference above to see what it
> says. It's a little bit of a PITA because we are using mutual-TLS
> authentication and the key+cert to connect to Solr is stored in our
> RDMBS. It'd doable... just not terribly convenient. Is there a SolrJ API
> I can call to get that info>? It might be slightly more convenient to do
> it that way.
>
> -chris
>

Reply via email to