.. _version_5.9.13:

==============
Version 5.9.13
==============

Released on 2025-04-07.
    
.. NOTE::
    If you are upgrading a cluster, you must be running CrateDB 4.0.2 or higher
    before you upgrade to 5.9.13.

    We recommend that you upgrade to the latest 5.8 release before moving to
    5.9.13.

    A rolling upgrade from 5.8.x to 5.9.13 is supported.

    Before upgrading, you should `back up your data`_.

.. WARNING::

    Tables that were created before CrateDB 4.x will not function with 5.x
    and must be recreated before moving to 5.x.x.

    You can recreate tables using ``COPY TO`` and ``COPY FROM`` or by
    `inserting the data into a new table`_.

.. _back up your data: https://crate.io/docs/crate/reference/en/latest/admin/snapshots.html

.. _inserting the data into a new table: https://crate.io/docs/crate/reference/en/latest/admin/system-information.html#tables-need-to-be-recreated

.. rubric:: Table of contents

.. contents::
   :local:

See the :ref:`version_5.9.0` release notes for a full list of changes in the
5.9 series.

Fixes
=====

- Fixed ram-accounting accuracy for upsert statements by using the table stats
  to estimate the average row size. If stats are not (yet) available, a rough
  estimate based on the table columns data types is used. By this, nodes should
  be prevented from running out of memory on large bulk updates.

- Tuned the sizing of internal intermediate result requests for statements like
  JOINS to reduce memory pressure on clusters with more than one node.

- Fixed an issue that could cause ``INSERT INTO`` statements which dynamically
  create thousands of columns to overload the cluster state update process
  before running into the ``mapping.total_fields.limit`` limit, causing other
  statements trying to update the cluster state to timeout.

- Fixed NPE when querying the :ref:`sys.allocations <sys-allocations>` table
  while no master node has been discovered. A proper exception is now thrown
  instead of an NPE.

- Fixed an issue that caused queries submitted via PG wire to not be logged in
  :ref:`sys.jobs_log <sys-logs>` in case of a parsing failure.

- Fixed an issue causing shards to not be allocated if the shard was not
  closed properly, e.g. due to an unclean node shutdown and the node was
  restarting with still holding a lock on the shard. The existing retry logic
  to solve this situation was not working in some cases.

- Fixed an issue causing a ``ALTER TABLE <table> RESET <setting>`` statement on
  a complete partitioned table to not reset the setting on all partitions, but
  only on the table itself, so the reset value of the setting would only have
  taken effect for new partitions.

- Fixed an issue that caused a ``MATCH`` query to silently override the
  specified analyzer with the analyzer that was used to index the corresponding
  column. Since this is not allowed, an error is now thrown.

- Fixed an issue that caused a cluster to have underreplicated shards if an
  ongoing ``INSERT`` or ``UPDATE`` operation was interrupted by ``KILL`` or
  a node restart.
