From ddde88fa3152ae1163d1d0d87816ed35a507d462 Mon Sep 17 00:00:00 2001 From: Rich Turner <7072278+richturner@users.noreply.github.com> Date: Sun, 18 Oct 2026 20:43:10 +0100 Subject: [PATCH 1/2] Clarify datapoint retention docs to match purge behaviour The DATA_POINTS_MAX_AGE_DAYS javadoc stated the meta item has no effect, but the purge still uses its largest value across all attributes as a minimum for the global retention period. Update the javadoc to describe this, and update the deploy.yml comment and README to document OR_DATA_POINTS_MAX_AGE_WEEKS and the infinite default retention. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- .../openremote/manager/datapoint/AssetDatapointService.java | 2 +- .../main/java/org/openremote/model/value/MetaItemType.java | 6 ++++-- profile/deploy.yml | 6 +++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9d936710d4..1f06f5faf6 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Try creating assets, agents, rules, users, realms, etc. using the Manager UI, pl ## Where's the data stored? Persistent data is stored in a PostgreSQL DB which is stored in the `openremote_postgresql-data` docker volume which is durably stored independently of the running containers (see all with `docker volume ls`). -Note that historical attribute data is purged daily based on value of `OR_DATA_POINTS_MAX_AGE_DAYS`; this value can also be overridden for individual attributes by using the `dataPointsMaxAgeDays` configuration item. +Note that historical attribute data is kept indefinitely by default; set `OR_DATA_POINTS_MAX_AGE_WEEKS` to purge data older than the given number of weeks. See the [Developer Guide](https://docs.openremote.io/docs/developer-guide/system-administration/#backuprestore) for details on making backups of the database. ## OpenTelemetry tracing diff --git a/manager/src/main/java/org/openremote/manager/datapoint/AssetDatapointService.java b/manager/src/main/java/org/openremote/manager/datapoint/AssetDatapointService.java index da1650bb72..0dffdb1344 100644 --- a/manager/src/main/java/org/openremote/manager/datapoint/AssetDatapointService.java +++ b/manager/src/main/java/org/openremote/manager/datapoint/AssetDatapointService.java @@ -64,7 +64,7 @@ /** * Store and retrieve datapoints for asset attributes and periodically purge data points using * TimescaleDB's {@code drop_chunks()} with week-based retention aligned to 7-day chunk intervals. - * Retention defaults to inifinite. + * Retention defaults to infinite. */ public class AssetDatapointService extends AbstractDatapointService implements ProtocolDatapointService { diff --git a/model/src/main/java/org/openremote/model/value/MetaItemType.java b/model/src/main/java/org/openremote/model/value/MetaItemType.java index e703a81299..b0710f99d3 100644 --- a/model/src/main/java/org/openremote/model/value/MetaItemType.java +++ b/model/src/main/java/org/openremote/model/value/MetaItemType.java @@ -102,8 +102,10 @@ public final class MetaItemType { * * @deprecated Per-attribute retention is no longer supported. Purging now uses TimescaleDB * drop_chunks with a global week-based retention period configured via - * OR_DATA_POINTS_MAX_AGE_WEEKS. This meta item is retained for backward compatibility but has - * no effect. + * OR_DATA_POINTS_MAX_AGE_WEEKS. For backward compatibility, the largest value of this meta + * item across all attributes (rounded up to whole weeks) is used as a minimum for the global + * retention period, so it can only extend how long data is kept for all attributes; it never + * shortens it and has no effect when purging is disabled. */ @Deprecated public static final MetaItemDescriptor DATA_POINTS_MAX_AGE_DAYS = diff --git a/profile/deploy.yml b/profile/deploy.yml index a1132a3887..ecb9c66497 100644 --- a/profile/deploy.yml +++ b/profile/deploy.yml @@ -358,9 +358,9 @@ services: # relative paths are resolved relative to OR_STORAGE_DIR OR_KEYCLOAK_GRANT_FILE: - # Configure the default max age for data points stored in the database (individual attributes can use a custom - # value by using the DATA_POINTS_MAX_AGE_DAYS AssetMeta item). - # OR_DATA_POINTS_MAX_AGE_DAYS: 30 + # Configure the max age in weeks for data points stored in the database; data points are kept indefinitely when + # not set. The deprecated OR_DATA_POINTS_MAX_AGE_DAYS is still used (rounded up to weeks) when this is not set. + # OR_DATA_POINTS_MAX_AGE_WEEKS: 4 # Configure the limit of data points that can be queried. # Defaults to 100.000. When set to 0, it disables the limit. From f4e3b75c04dfc34bab37705e66571d028b89a377 Mon Sep 17 00:00:00 2001 From: Rich Turner <7072278+richturner@users.noreply.github.com> Date: Tue, 20 Oct 2026 10:18:58 +0100 Subject: [PATCH 2/2] Clarify deprecation notice for STORE_DATA_POINTS Updated deprecation comment for STORE_DATA_POINTS to clarify changes in retention policy. --- .../main/java/org/openremote/model/value/MetaItemType.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/src/main/java/org/openremote/model/value/MetaItemType.java b/model/src/main/java/org/openremote/model/value/MetaItemType.java index b0710f99d3..723ed7a108 100644 --- a/model/src/main/java/org/openremote/model/value/MetaItemType.java +++ b/model/src/main/java/org/openremote/model/value/MetaItemType.java @@ -97,8 +97,8 @@ public final class MetaItemType { new MetaItemDescriptor<>("storeDataPoints", ValueType.BOOLEAN); /** - * How long to store attribute values in time series database (data older than this will be - * automatically purged). + * Previously set how long to store attribute values in the time series database (data older than + * this would have been automatically purged). * * @deprecated Per-attribute retention is no longer supported. Purging now uses TimescaleDB * drop_chunks with a global week-based retention period configured via