apache / apache/iotdb

[Bug] Query is aborted since it requests more memory than can be allocated

Offen
#15,906 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
6.4k
Forks
1.2k
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
115

Beschreibung

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.

### Version

Iotdb:2.0.4-standalone official docker deployment

### Describe the bug and provide the minimal reproduce step

a query with 500 devices and group by 1d leads to:
`Query is aborted since it requests more memory than can be allocated, bytesToReserve: 2945552B, maxBytesCanReserve: 1159642B`
even though my On heap size is set to 200GB and the Off heap size is set to 30GB.
The instance has 256GB of available ram.
The 500 devices have 10 measurements with exactly one data point per day.
The query:

`select sum(*) from [path1,path2,...path500] group by ([2025-07-01T00:00:00, 2025-07-31T23:59:59), 1d)
`
same for
`select sum(*) from root.db.* group by ([2025-07-01T00:00:00, 2025-07-31T23:59:59), 1d)
`

docker-compose.yml setup:
```
version: "3"
services:
iotdb-service:
image: apache/iotdb:2.0.4-standalone
hostname: iotdb
container_name: iotdb
restart: always
ports:
- "6667:6667"
environment:
- cn_internal_address=iotdb
- cn_internal_port=10710
- cn_consensus_port=10720
- cn_seed_config_node=iotdb:10710
- dn_rpc_address=iotdb
- dn_internal_address=iotdb
- dn_rpc_port=6667
- dn_internal_port=10730
- dn_mpp_data_exchange_port=10740
- dn_schema_region_consensus_port=10750
- dn_data_region_consensus_port=10760
- dn_seed_config_node=iotdb:10710
privileged: true
volumes:
- /app/config/iotdb/conf:/iotdb/conf
- /app/data/iotdb/data:/iotdb/data
- /app/data/iotdb/logs:/iotdb/logs
networks:
iotdb:
ipv4_address: 172.18.0.6

networks:
iotdb:
external: true
```

iotdb startup log with info about memory:

> iotdb | setting local JMX...
> iotdb | DataNode on heap memory size = 200GB, off heap memory size = 30GB
> iotdb | If you want to change this configuration, please check conf/datanode-env.sh.
> iotdb | 2025-07-10 09:14:01,192 [main] INFO o.a.i.d.c.IoTDBDescriptor:225 - Start to read config file file:/iotdb/conf/iotdb-system.properties
> iotdb | 2025-07-10 09:14:01,218 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:203 - initial allocateMemoryForWrite = 64424509440
> iotdb | 2025-07-10 09:14:01,218 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:206 - initial allocateMemoryForRead = 64424509440
> iotdb | 2025-07-10 09:14:01,219 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:208 - initial allocateMemoryForSchema = 21474836480
> iotdb | 2025-07-10 09:14:01,219 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:211 - initial allocateMemoryForConsensus = 21474836480
> iotdb | 2025-07-10 09:14:01,219 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:214 - initial allocateMemoryForPipe = 21474836480
> iotdb | 2025-07-10 09:14:01,219 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:277 - allocateMemoryForSchemaRegion = 10737418240
> iotdb | 2025-07-10 09:14:01,219 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:280 - allocateMemoryForSchemaCache = 8589934592
> iotdb | 2025-07-10 09:14:01,219 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:282 - allocateMemoryForPartitionCache = 2147483648
> iotdb | 2025-07-10 09:14:01,245 [main] INFO o.a.t.c.c.TSFileDescriptor:136 - try loading iotdb-system.properties from /iotdb/conf/iotdb-system.properties
> iotdb | 2025-07-10 09:14:01,255 [main] INFO o.a.i.d.c.IoTDBDescriptor:1808 - MQTT host is not configured, will use dn_rpc_address.
> iotdb | 2025-07-10 09:14:01,269 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:203 - initial allocateMemoryForWrite = 64424509440
> iotdb | 2025-07-10 09:14:01,269 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:206 - initial allocateMemoryForRead = 64424509440
> iotdb | 2025-07-10 09:14:01,270 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:208 - initial allocateMemoryForSchema = 21474836480
> iotdb | 2025-07-10 09:14:01,270 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:211 - initial allocateMemoryForConsensus = 21474836480
> iotdb | 2025-07-10 09:14:01,270 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:214 - initial allocateMemoryForPipe = 21474836480
> iotdb | 2025-07-10 09:14:01,270 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:277 - allocateMemoryForSchemaRegion = 10737418240
> iotdb | 2025-07-10 09:14:01,270 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:280 - allocateMemoryForSchemaCache = 8589934592
> iotdb | 2025-07-10 09:14:01,270 [main] INFO o.a.i.d.c.DataNodeMemoryConfig:282 - allocateMemoryForPartitionCache = 2147483648
>

### What did you expect to see?

using more ram and execute this query

### What did you see instead?

an error with maxBytesCanReserve: 1159642B which seems to be way to small

### Anything else?

i already tried to set
IOTDB_MAX_QUERY_MEMORY_PER_FRAGMENT_INSTANCE and IOTDB_MAX_QUERY_MEMORY but this does not seem to have an effect
I also tried to disable enable_query_memory_estimation

it would be greatly appreciated if someone would have a clue about how to fix that
thanks in advance and i wish you all a good day!

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit dem Setup von docker-compose.yml, conf/datanode-env.sh, den Speicherprotokollen beim Start und der gemeldeten Group-by-Abfrage. Reproduziere den Fehler und verfolge, warum maxBytesCanReserve trotz der konfigurierten Heap-, Off-Heap- und Query-Memory-Einstellungen bei 1159642B bleibt. Als abgeschlossen gilt die Untersuchung, wenn das Konfigurationsverhalten verstanden ist und die Abfrage ausgeführt wird oder das Problem eindeutig diagnostiziert ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
docker, java
Bereich
databases
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.