8000 Query with MIN on collected variable crashes Db · Issue #14807 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Query with MIN on collected variable crashes Db #14807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JosipVuckovic opened this issue Sep 21, 2021 · 7 comments
Closed

Query with MIN on collected variable crashes Db #14807

JosipVuckovic opened this issue Sep 21, 2021 · 7 comments
Labels
1 Bug 2 Fixed Resolution 3 AQL Query language related
Milestone

Comments

@JosipVuckovic
Copy link
JosipVuckovic commented Sep 21, 2021

My Environment

  • ArangoDB Version: 3.8.1
  • Storage Engine: RocksDB
  • Deployment Mode: Single Server
  • Deployment Strategy: ArangoDB Starter
  • Configuration:
  • Infrastructure: own
  • Operating System: Windows 10
  • Total RAM in your machine:
  • Disks in use: SSD
  • Used Package: other

Component, Query & Data

Affected feature:
ArangoDb instance

AQL query (if applicable):

for u in union([],[])
                collect test = u.v into g
                return Distinct {
                    Test: test,
                    Prop1: MIN(g[*].u.someProp),
                    Prop2: MAX(g[*].u.someProp)
                }

AQL explain and/or profile (if applicable):

Execution plan:
 Id   NodeType            Est.   Comment
  1   SingletonNode          1   * ROOT
  2   CalculationNode        1     - LET #7 = [ ]   /* json expression */   /* const assignment */
  3   EnumerateListNode      0     - FOR u IN #7   /* list iteration */
  4   CalculationNode        0       - LET #9 = u.`v`   /* attribute expression */
  9   SortNode               0       - SORT #9 ASC   /* sorting strategy: standard */
  5   CollectNode            0       - COLLECT test = #9 INTO g KEEP u   /* sorted */
  6   CalculationNode        0       - LET #11 = { "Test" : test, "Prop1" : MIN(g[*].`u`.`someProp`), "Prop2" : MAX(g[*].`u`.`someProp`) }   /* simple expression */
  7   CollectNode            0       - COLLECT #13 = #11   /* distinct */
  8   ReturnNode             0       - RETURN #13
Indexes used:
 none
Functions used:
 Name   Deterministic   Cacheable   Uses V8
 MIN    true            true        false
 MAX    true            true        false
Optimization rules applied:
 Id   RuleName
  1   remove-collect-variables
Optimization rules with highest execution times:
 RuleName                                    Duration [s]
 remove-collect-variables                         0.00002
 specialize-collect                               0.00002
 remove-redundant-calculations                    0.00001
 use-indexes                                      0.00001
 optimize-count                                   0.00000
41 rule(s) executed, 1 plan(s) created

Dataset:
N/A

Size of your Dataset on disk:
minimal

Replication Factor & Number of Shards (Cluster only):
N/A

Steps to reproduce

  1. Just run the AQL query

Problem:
Whole ArangoDb instance crashes, i.e. I need to manually restart the ArangoDb service.

Expected result:
Load data

@JosipVuckovic JosipVuckovic changed the title Query with MIN on collected variable Query with MIN on collected variable crashes Db Sep 21, 2021
@goedderz
Copy link
Member

Hi @JosipVuckovic,

I tried to reproduce it, but cannot: I get an empty result set as expected.

Is there something in the arangod log files that you can share?

Best,

Tobias

@JosipVuckovic
Copy link
Author
JosipVuckovic commented Sep 22, 2021

The log file was empty, on the machine I am running 3.7.2 I also got the empty result as expected, but on this with 3.8.1. it keeps crashing.

@Simran-B
Copy link
Contributor

I can confirm that running the query in 3.8.1 crashes on Windows 10, but the Docker container does not.

{crash} Unhandled exception: c0000005 at address 00007ff6192b8ab0 in thread 407c

Here's what WinDbg reported:

arangod!std::_Fnv1a_append_bytes [inlined in arangod!std::_Fnv1a_append_value<unsigned int>]:
00007ff6`192b8ab0 440fb602        movzx   r8d,byte ptr [rdx] ds:00000000`00000000=??
[0x0]   arangod!std::_Fnv1a_append_bytes   
[0x1]   arangod!std::_Fnv1a_append_value<unsigned int>   
[0x2]   arangod!std::hash<unsigned int>::_Do_hash + 0x8   
[0x3]   arangod!std::_Conditionally_enabled_hash<unsigned int,1>::operator() + 0x8   
[0x4]   arangod!emilib::HashSet<unsigned int,std::hash<unsigned int>,emilib::HashSetEqualTo<unsigned int> >::find_filled_bucket + 0x12   
[0x5]   arangod!emilib::HashSet<unsigned int,std::hash<unsigned int>,emilib::HashSetEqualTo<unsigned int> >::find + 0x12   
[0x6]   arangod!arangodb::aql::removeCollectVariablesRule + 0x3a3   
[0x7]   arangod!arangodb::aql::Optimizer::createPlans + 0x29a   
[0x8]   arangod!arangodb::aql::Query::preparePlan + 0x32b   
[0x9]   arangod!arangodb::aql::Query::prepareQuery + 0x4e   
[0xa]   arangod!arangodb::aql::Query::execute + 0x42d   
[0xb]   arangod!arangodb::RestCursorHandler::processQuery + 0x56   
[0xc]   arangod!arangodb::RestCursorHandler::registerQueryOrCursor + 0x762   
[0xd]   arangod!arangodb::RestCursorHandler::createQueryCursor + 0xbf   
[0xe]   arangod!arangodb::rest::RestHandler::executeEngine + 0xac   
[0xf]   arangod!arangodb::rest::RestHandler::runHandlerStateMachine + 0x10c   
[0x10]   arangod!arangodb::rest::RestHandler::runHandler + 0x85   
[0x11]   arangod!arangodb::rest::CommTask::handleRequestAsync::__l8::<lambda_c796163337351d47c76198ea236ce46f>::operator() + 0x51   
[0x12]   arangod!arangodb::Scheduler::WorkItem<<lambda_c796163337351d47c76198ea236ce46f> >::invoke + 0x5a   
[0x13]   arangod!arangodb::SupervisedScheduler::runWorker + 0x247   
[0x14]   arangod!arangodb::Thread::runMe + 0x34   
[0x15]   arangod!arangodb::Thread::startThread + 0xc0   
[0x16]   arangod!ThreadStarter + 0x1b   
[0x17]   KERNEL32!BaseThreadInitThunk + 0x14   
[0x18]   ntdll!RtlUserThreadStart + 0x21   

@Simran-B Simran-B added 1 Bug 3 AQL Query language related labels Sep 23, 2021
@JosipVuckovic
Copy link
Author

@Simran-B Thank you for the information, we can then use docker as a gap solution.

@goedderz
Copy link
Member

@mpoeter and I found the bug, a bugfix is prepared (see #14824 /
#14825).

KVS85 added a commit that referenced this issue Sep 28, 2021
* Fixed issue #14807; added regression tests and CHANGELOG entry

* Update CHANGELOG

Co-authored-by: Vadim <vadim@arangodb.com>
< 8000 div class="js-timeline-item js-timeline-progressive-focus-container" data-gid="IC_kwDOAChsfs43YoOK">
@goedderz
Copy link
Member

@JosipVuckovic The fix was merged and will be released with 3.8.2.

@goedderz goedderz added this to the 3.8.2 milestone Sep 28, 2021
@goedderz goedderz added the 2 Fixed Resolution label Sep 28, 2021
@JosipVuckovic
Copy link
Author

@goedderz
Thank you for the info and quick fix.

KVS85 added a commit that referenced this issue Sep 29, 2021
* Fixed issue #14807; added regression tests and CHANGELOG entry

* Update CHANGELOG

* Update CHANGELOG

Co-authored-by: Vadim <vadim@arangodb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 Bug 2 Fixed Resolution 3 AQL Query language related
Projects
None yet
Development

No branches or pull requests

3 participants
0