Commit Graph

827 Commits

Author SHA1 Message Date
florijan
95ce34cc0a Mvcc.GcDeleted bugfix and test
Summary: Changed mvcc::VersionList::GcDeleted to look for the oldest visible record.

Reviewers: teon.banek, buda, dgleich

Reviewed By: teon.banek, dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D378
2017-05-18 16:02:42 +02:00
Teon Banek
663d78feaa Handle expanding from Null vertex
Summary:
This fixes a bug when the MATCH clause would follow an OPTIONAL MATCH.
In case when the optional part would fail to generate results, expanding
would cause an error.

Reviewers: florijan, mislav.bradac, buda

Reviewed By: mislav.bradac, buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D372
2017-05-18 09:04:16 +02:00
Dominik Gleich
22ea809c67 Fix tck - and all of memgraph in the process.
Summary:
When running tck tests there was a peculiar behavior where sometimes some queries worked, and sometimes they failed. Nothing was failing when memgraph was restarted between each query (scenario) - which points to MATCH DETACH DELETE not working correctly.

What was happening is the following: some transaction would update the record in version list and set it's expiry to it's id. Along with that some transaction would query the mentioned record - and would set the hints flags for that expiration transaction status (which was aborted - which is fine at this moment). After some while, because the record is not really deleted because it's not aborted some other transaction would modify it's expiry transaction (this time making the transaction commited), but because the hints flags were not updated - they would still return the status for the old transaction - which was aborted. This made some records available even though they were deleted.

Reviewers: mislav.bradac, florijan, teon.banek, matej.gradicek, buda

Reviewed By: buda

Subscribers: buda, lion, pullbot

Differential Revision: https://phabricator.memgraph.io/D370
2017-05-17 15:27:40 +02:00
Teon Banek
8380d3694f Raise semantic error when redeclaring node in MERGE
Summary:
openCypher expects MERGE to behave like CREATE. As such, it shouldn't be
allowed to refer to declared nodes, while providing labels and
properties.

Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D373
2017-05-17 15:08:38 +02:00
Teon Banek
30a4f40093 Skip Null in SET and REMOVE clauses
Summary:
openCypher expects removing/setting properties and labels on Null
vertices/edges does not produce an error. Instead, Nulls are simply
skipped.

Reviewers: florijan, mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D375
2017-05-17 15:07:03 +02:00
Teon Banek
8d8ef19694 Raise in ParseDouble with empty string or float overflow
Summary:
The check is made more robust by using the `fail` accessor along with
`eof`.

Reviewers: florijan, buda, mislav.bradac, dgleich

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D376
2017-05-17 14:52:42 +02:00
matej.gradicek
e791e9b660 Summary:Added files for snapshot durability
Summary:
File buffer added

Implemented little more of snapshoter.

Resolved conflicts

More stuff implemented of snapshot durability.

More things in snapshoter.

Refactored, added comments

Merge branch 'dev' into durability_snapshot

Merge branch 'dev' into durability_snapshot

Resolved bug in scheduler, snapshoter is running in grpah_db.

Reviewers: mferencevic, buda, dgleich, mislav.bradac

Reviewed By: mferencevic, buda, dgleich, mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D232
2017-05-17 08:42:00 +00:00
Teon Banek
8cdf87e109 Bind UNWIND symbols during planning
Reviewers: florijan, mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D371
2017-05-17 10:37:12 +02:00
Dominik Gleich
842901ecd2 LabelProperty index.
Summary:
Add return values.

After merge.

Inital working version. Still missing comments.

Update documentation.

Add checking for previous vlist and value equality.

After merge.

Remove functor, add boolean ffunction.

Build index.

More functionality. Start implementing tests.

Add tests.

Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan

Reviewed By: mislav.bradac, buda, florijan

Subscribers: lion, florijan, teon.banek, buda, pullbot

Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 16:33:20 +02:00
Dominik Gleich
4b712595d9 Global thread pool added.
Summary: Global thread pool implementation.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D369
2017-05-16 16:23:55 +02:00
Teon Banek
23ab2b41a3 Refactor ExpressionEvaluator to classic visitor
Reviewers: florijan, mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D368
2017-05-16 15:33:47 +02:00
matej.gradicek
f74ba586b2 Implemented mvcc tests as discused with flor(two different transactions operations)
Reviewers: florijan, buda, dgleich

Reviewed By: florijan, buda

Subscribers: dtomicevic, teon.banek, buda, pullbot

Differential Revision: https://phabricator.memgraph.io/D359
2017-05-16 12:09:29 +00:00
Teon Banek
15d7226515 Add classic and hierarchical visiting
Summary:
Merge utils/visitor directory into single file.
Rename Visitor to HierarchicalVisitor.
Add regular Visitor.
Split HierarchicalVisitor into LeafVisitor and CompositeVisitor.
Add more documentation on visitor pattern.
Make PostVisit and Visit return bool.

Reviewers: florijan, mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D364
2017-05-16 12:35:09 +02:00
Matej Ferencevic
9640633dd1 Loosen up handshake size checks to accept javascript clients.
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D366
2017-05-16 10:55:19 +02:00
Teon Banek
87e5dc0dfb Plan '*' in RETURN and WITH
Summary:
Make Symbol members read only.
Check WITH/RETURN * in SymbolGenerator.
Test semantic checks for WITH/RETURN *.
Sort expanded user identifiers by name.
Test planning WITH/RETURN *.

Reviewers: buda, florijan, mislav.bradac

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D357
2017-05-12 13:05:40 +01:00
Mislav Bradac
f82bda6c0c Implement Range function
Reviewers: teon.banek, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D358
2017-05-10 17:12:15 +02:00
Matej Ferencevic
aeacdfc631 Added TCP_NODELAY to server sockets.
Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D362
2017-05-10 15:05:05 +02:00
Mislav Bradac
a236d704a3 Join filters with FilterAnd (short-circuit)
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D356
2017-05-08 15:49:49 +02:00
Teon Banek
be81751db3 Allow filter symbols in Match to be out of binding order
Summary:
Check symbols in property maps after visiting Match.
Plan Filters as soon as possible.
Take AstTreeStorage in MakeLogicalPlan instead of Query.
Plan generic Filter instead of specialized operators.
Remove traces of EdgeFilter and NodeFilter.

Reviewers: buda, mislav.bradac, florijan

Reviewed By: mislav.bradac, florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D344
2017-05-08 12:03:38 +02:00
florijan
0866fdcb0c Query:: COUNT(*) added to logical planning and execution
Reviewers: mislav.bradac, buda, teon.banek

Reviewed By: mislav.bradac, teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D353
2017-05-08 11:19:57 +02:00
Mislav Bradac
871b81656b Implement InListOperator
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D354
2017-05-07 17:52:08 +02:00
Mislav Bradac
5ae55499bc Convert escaped labels to AST
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D352
2017-05-06 15:34:02 +02:00
Mislav Bradac
b76685cba7 Fix bug
Reviewers: buda

Reviewed By: buda

Differential Revision: https://phabricator.memgraph.io/D351
2017-05-05 20:10:32 +02:00
Mislav Bradac
3d026b106d Handle asterisk in AST conversion
Summary: TODO: Handle COUNT_ASTERISK aggregation in operator (will do in next diff)

Reviewers: teon.banek, florijan, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D350
2017-05-05 20:01:56 +02:00
Dominik Gleich
3428a9bfbd Fix assert fail.
Summary: Assert fail introduced by me, by incorrectly fixing skiplist find_or_larger.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D349
2017-05-05 18:46:10 +02:00
Florijan Stamenkovic
1333bfeb39 Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices

What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor

Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)

Reviewers: dgleich, matej.gradicek, buda

Reviewed By: matej.gradicek, buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 14:46:18 +02:00
Mislav Bradac
cfb987a90c Evaluate epressions EdgeTypeTest and LabelsTest
Reviewers: florijan, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D345
2017-05-05 13:25:23 +02:00
Mislav Bradac
72d4a67c4a Convert labels test from antlr to AST
Reviewers: florijan, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D346
2017-05-05 12:13:55 +02:00
Dominik Gleich
3b4e66e0e3 Fix hang.
Summary: Thread pool had the same bug as scheduler before, missing condition variable notifications because of not holding lock while emitting notification.

Reviewers: teon.banek, buda

Reviewed By: teon.banek

Differential Revision: https://phabricator.memgraph.io/D347
2017-05-05 10:28:50 +02:00
Mislav Bradac
2e9c0e4cb9 Implement evaluation of list indexing and slicing
Reviewers: florijan, teon.banek

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D342
2017-05-04 15:34:33 +02:00
Mislav Bradac
d2f9affb4c Add labels and edge type test nodes to ast
Reviewers: teon.banek

Reviewed By: teon.banek

Differential Revision: https://phabricator.memgraph.io/D343
2017-05-04 14:55:22 +02:00
florijan
0968224a3d Query::Delete - can now delete Null (naturally occuring in optional match)
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D339
2017-05-04 10:35:20 +02:00
Mislav Bradac
cb7310fb6a Add list indexing and slicing conversion to AST
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D341
2017-05-03 19:40:34 +02:00
Teon Banek
d06f80e3f3 Plan Distinct
Summary:
Support WITH/RETURN DISTINCT in test macros.
Test planning Distinct.
Implement OutputSymbols in Distinct operator.

Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D340
2017-05-03 16:35:48 +02:00
Dominik Gleich
b6c26a1a86 Fix Jenkins hang.
Summary:
Jenkins would hang at a random time while running all the tests.
The reason for that is a bug in skiplist implementation.

Skiplist method find_or_larger was never ending and would continuously stay in the while loop because the next node (with the queried value) onto which it would try to jump would be marked as deleted and that would stop it from jumping on it, or ending on that node.

Reviewers: buda, teon.banek, mislav.bradac

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D334
2017-05-03 15:58:46 +02:00
florijan
0a33a555a6 GraphDdAccessor and KeyIndex API upgrades. Test refactoring
Summary:
The GraphDbAccessor and KeyIndex APIs can now also return records for the current transaction+command graph state. This is necessary to correctly implement MERGE. The new logic is has increased the MVCC+Accessor related chaos and should be revised when refactoring MVCC (as planned).

Previous index testing was separated into VertexIndex and EdgeIndex testing. This is inappropriate since most of the logic is exaclty the same. Also it was not clearly defined what gets tested via the GraphDbAccessor API, and what directly through the KeyIndex API. This has also been refactored, but it needs additional work (Gleich).

Reviewers: buda, dgleich

Reviewed By: buda, dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D306
2017-05-03 15:42:04 +02:00
florijan
355f62ce71 Query::Plan - Distinct added
Reviewers: buda, mislav.bradac, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D336
2017-05-03 15:27:24 +02:00
Matej Ferencevic
b6ff1e1bbc Removed large bolt encoder test to reduce runtime.
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D338
2017-05-03 14:50:02 +02:00
Matej Ferencevic
18782e67fd Fixed bolt encoder test.
Summary: Fixed encoder off-by-one limit.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D335
2017-05-03 14:33:33 +02:00
Teon Banek
cbd3998899 Plan Unwind operator
Summary:
Support ListLiteral in test macros.
Test planning Unwind.
Support UNWIND in test macros.
Test SymbolGenerator for UNWIND clause.
Use namespace in QueryPlan Unwind test.

Reviewers: mislav.bradac, buda, florijan

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D331
2017-05-03 13:54:33 +02:00
Teon Banek
eef6fb1981 Convert antlr Unwind to AST
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D330
2017-05-03 12:32:18 +02:00
Dominik Gleich
487f429d5b Add concurrent benchmarks for skiplist.
Summary: Skiplist benchmark and refactor testing infrastructure.

Reviewers: mferencevic, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D103
2017-05-03 11:03:23 +02:00
florijan
ffc977dbfc Query::Plan::Unwind added
Reviewers: teon.banek, mislav.bradac, buda

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D328
2017-05-03 08:38:25 +02:00
florijan
dc5ef33c8f Query::ExpresionEval - Null.prop is now Null
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D329
2017-05-03 08:36:56 +02:00
florijan
2e5eccf197 Query::AST::Literal refactor. Repl and TypedValue mods.
Summary:
- Query::AST::Literal refactor (LiteralBase introduced, ListLiteral added)
- Repl now prints out list TypedValues properly
- TypedValue to string conversion refactors

Reviewers: teon.banek, mislav.bradac, buda

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D327
2017-04-28 14:58:16 +02:00
Teon Banek
9653c703dc Plan optional matching
Summary:
Support OPTIONAL MATCH in test macros.
Test planning Optional.

Reviewers: florijan, mislav.bradac

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D322
2017-04-28 14:03:08 +02:00
Teon Banek
3b9d13f1e1 Fix errors introduced in D298
Reviewers: florijan, mislav.bradac, mferencevic, buda

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D326
2017-04-28 11:11:32 +02:00
Marko Budiselic
e6191eadb4 The rest of core engine exceptions are extended from the BasicException (because of the error handling in the communication stack). Maximum value of the MVCC command id is calculated in the compile time.
Summary:
The rest of core engine exceptions are extended from the BasicException (because of the error handling in the communication stack). Maximum value of the MVCC command id is calculated in the compile time.

I've put the tasks to implement concurrent tests in the qa repo in the backlog. Hopefully they will be implemented within this sprint.

Reviewers: mislav.bradac, mferencevic, florijan

Reviewed By: mislav.bradac

Subscribers: dgleich, pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D298
2017-04-27 13:17:40 -04:00
Mislav Bradac
78af8c8339 Add variable with all memgraph dependent libraries
Reviewers: teon.banek, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D324
2017-04-27 18:40:34 +02:00
Teon Banek
35a35f0d5f Split semantic tests into test cases
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D323
2017-04-27 14:18:38 +02:00