As part of the fixes for https://github.com/influxdata/influxdb/issues/23172, port - https://github.com/influxdata/influxdb/pull/23396 to the 1.10 branch.