TSI index and open files limit, release 5.3.0 #5

Merged
tim merged 1 commit from feat/tsi-index-open-files-4 into main 2026-11-03 11:39:18 +00:00
Owner

Closes #4.

Adopts the parts of upstream v6.0.0 (hassio-addons/app-influxdb#417) that touch the InfluxDB server this fork keeps. Chronograf, Kapacitor, ports and nginx parts do not apply.

Changes

  • index-version = "tsi1" in influxdb.conf.
  • ulimits: nofile: 65535 in config.yaml (needs Supervisor 2025.10 or newer; the Supervisor add-on schema uses REMOVE_EXTRA, so an older one drops the key instead of rejecting the add-on). Because of that, the run script also raises the soft limit up to the hard limit if it is lower, and logs Open files limit: N at start.
  • DOCS.md: what the TSI setting does to existing data, how to convert, the open files limit.
  • Version 5.3.0.

What I tested (InfluxDB 1.13.2, the same package the Dockerfile installs)

I did not take the upstream PR text on trust, because the issue says switching the index on an existing data dir is a decision. On a data dir created with the current config (3 shards, in-memory index):

Step Result
Restart with tsi1 all old data readable, series count unchanged; log warns Mixed shard index types
Write into an old shard, and into a new shard group works; old shards stay in-memory (no index dir), the new shard gets one
influx_inspect buildtsi -datadir ... -waldir ... with influxd stopped, run as the same non-root user TSI rebuild completed successfully, every shard now has an index dir; data and series counts unchanged; no mixed warning afterwards
Roll back: converted data dir + the old config all data readable, no warnings or errors

The memory benefit therefore only reaches shards created after the update until the old ones are converted. Numbers for a real data volume (conversion time, extra disk) are not measured; the test dataset is tiny (data dir 244 KB before, 472 KB after conversion, which is not representative).

The run script was executed for real (stub bashio, stub influxd reporting its inherited limit) under docker --ulimit nofile=: 1024:1048576 (the HAOS 16 case) -> 65535; 1024:4096 -> 4096; 65535:65535 and 200000:200000 unchanged (never lowered); 1024:1024 stays 1024 without a warning. influxd config on the repo file shows index-version = "tsi1", and the cont-init.d seds leave it alone. The add-on image builds locally (amd64 base) with the run script executable and the new line in place; the CI workflow builds aarch64 without pushing.

Not tested: a real Supervisor (the ulimits option's effect on the container), and a real Home Assistant OS.

Deploy note (not part of this PR)

Releasing this deploys nothing. Updating the add-on on a Home Assistant instance with existing data starts with the mixed index state above and is safe; converting is a separate, optional step that needs the add-on stopped.

🤖 Generated with Claude Code

Closes #4. Adopts the parts of upstream v6.0.0 (hassio-addons/app-influxdb#417) that touch the InfluxDB server this fork keeps. Chronograf, Kapacitor, ports and nginx parts do not apply. ## Changes - `index-version = "tsi1"` in `influxdb.conf`. - `ulimits: nofile: 65535` in `config.yaml` (needs Supervisor 2025.10 or newer; the Supervisor add-on schema uses `REMOVE_EXTRA`, so an older one drops the key instead of rejecting the add-on). Because of that, the run script also raises the soft limit up to the hard limit if it is lower, and logs `Open files limit: N` at start. - `DOCS.md`: what the TSI setting does to existing data, how to convert, the open files limit. - Version 5.3.0. ## What I tested (InfluxDB 1.13.2, the same package the Dockerfile installs) I did not take the upstream PR text on trust, because the issue says switching the index on an existing data dir is a decision. On a data dir created with the current config (3 shards, in-memory index): | Step | Result | |---|---| | Restart with `tsi1` | all old data readable, series count unchanged; log warns `Mixed shard index types` | | Write into an old shard, and into a new shard group | works; old shards stay in-memory (no `index` dir), the new shard gets one | | `influx_inspect buildtsi -datadir ... -waldir ...` with influxd stopped, run as the same non-root user | `TSI rebuild completed successfully`, every shard now has an `index` dir; data and series counts unchanged; no mixed warning afterwards | | Roll back: converted data dir + the old config | all data readable, no warnings or errors | The memory benefit therefore only reaches shards created after the update until the old ones are converted. Numbers for a real data volume (conversion time, extra disk) are **not** measured; the test dataset is tiny (data dir 244 KB before, 472 KB after conversion, which is not representative). The run script was executed for real (stub `bashio`, stub `influxd` reporting its inherited limit) under `docker --ulimit nofile=`: `1024:1048576` (the HAOS 16 case) -> 65535; `1024:4096` -> 4096; `65535:65535` and `200000:200000` unchanged (never lowered); `1024:1024` stays 1024 without a warning. `influxd config` on the repo file shows `index-version = "tsi1"`, and the `cont-init.d` seds leave it alone. The add-on image builds locally (amd64 base) with the run script executable and the new line in place; the CI workflow builds aarch64 without pushing. Not tested: a real Supervisor (the `ulimits` option's effect on the container), and a real Home Assistant OS. ## Deploy note (not part of this PR) Releasing this deploys nothing. Updating the add-on on a Home Assistant instance with existing data starts with the mixed index state above and is safe; converting is a separate, optional step that needs the add-on stopped. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
TSI index and open files limit, release 5.3.0
All checks were successful
Build / Build influxdb image (aarch64) (pull_request) Successful in 18s
fc9bc174ae
Adopted from upstream v6.0.0 (hassio-addons/app-influxdb#417), the parts
that touch the InfluxDB server this fork keeps:

- index-version = "tsi1" in influxdb.conf. Only new shards get it; the
  existing in-memory shards keep working unchanged (verified on InfluxDB
  1.13.2: data stays readable, writes into old shards work, new shards get
  an index directory, a "Mixed shard index types" warning is logged, and
  rolling the config back on a converted data dir works). Converting old
  shards needs influx_inspect buildtsi with influxd stopped; DOCS.md says so.
- ulimits nofile 65535 in config.yaml (Supervisor 2025.10 or newer; the
  Supervisor schema drops the key on older versions), plus a raise of the
  soft limit in the run script up to the hard limit for those, and a log
  line with the limit in effect. Tested under several docker ulimit settings
  with the real run script.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tim merged commit 3a64519c67 into main 2026-11-03 11:39:18 +00:00
tim deleted branch feat/tsi-index-open-files-4 2026-11-03 11:39:19 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
tim/hass-influxdb!5
No description provided.