#6132·nebula

在 MATCH 可变长路径中通过组合爆炸进行操作

作者: splendorLee创建于 2025年12月21日更新于 2025年12月21日
标签type/bugseverity/noneaffects/none

Connect to the NebulaGraph console. Set up a test space and a small, fully connected graph (6 nodes, mesh topology): CREATE SPACE IF NOT EXISTS test(partition_num=1, replica_factor=1, vid_type=INT64); USE test; CREATE TAG VLP(id int); CREATE EDGE NEXT(); INSERT VERTEX VLP(id) VALUES 10:(10), 11:(11), 12:(12), 13:(13), 14:(14), 15:(15); INSERT EDGE NEXT() VALUES 10->11:(), 10->12:(), 10->13:(), 10->14:(), 10->15:(), 11->10:(), 11->12:(), 11->13:(), 11->14:(), 11->15:(), 12->10:(), 12->11:(), 12->13:(), 12->14:(), 12->15:(), 13->10:(), 13->11:(), 13->12:(), 13->14:(), 13->15:(), 14->10:(), 14->11:(), 14->12:(), 14->13:(), 14->15:(), 15->10:(), 15->11:(), 15->12:(), 15->13:(), 15->14:(); Execute a variable length path query with high depth: MATCH p=(a:VLP)-[:NEXT*1..18]->(b:VLP) WHERE id(a) == 10 RETURN count(p); Observation: The service crashes with an OOM error. Server Logs: Out of memory: Killed process XXXXXX (nebula-graphd) total-vm:272812532kB... Suggested Remediation: Optimize the count(p) aggregation to avoid storing full path data in memory when only the count is required. Implement stricter memory limits for intermediate results during traversal steps (BFS/DFS). Set a default maximum hop limit or a timeout that triggers a graceful error rather than a process crash when memory pressure becomes critical. Crash Evidence: (root@nebula) [(none)]> CREATE SPACE IF NOT EXISTS test(partition_num=1, replica_factor=1, vid_type=INT64); Execution succeeded (time spent 1.49ms/2.035736ms) Sun, 07 Dec 2025 06:23:12 UTC (root@nebula) [(none)]> USE test; Execution succeeded (time spent 1.133ms/1.590491ms) Sun, 07 Dec 2025 06:23:20 UTC (root@nebula) [test]> CREATE TAG VLP(id int); Execution succeeded (time spent 2.104ms/2.92039ms) Sun, 07 Dec 2025 06:23:59 UTC (root@nebula) [test]> CREATE EDGE NEXT(); Execution succeeded (time spent 13.843ms/14.353045ms) Sun, 07 Dec 2025 06:24:04 UTC (root@nebula) [test]> INSERT VERTEX VLP(id) VALUES 10:(10), 11:(11), 12:(12), 13:(13), 14:(14), 15:(15); Execution succeeded (time spent 6.731ms/7.343505ms) Sun, 07 Dec 2025 06:24:54 UTC (root@nebula) [test]

内容来源: vesoft-inc/nebula