Commit Graph

2841 Commits

Author SHA1 Message Date
Matej Ferencevic
d68106051c Replace hardcoded configuration with generator
Summary:
The configuration file that was used for the Debian/CentOS package was manually
written. This diff adds a configuration file generator that extracts all of the
necessary information about the flags directly from the built binary and uses
that information to generate the configuration file for the packages.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2589
2019-12-09 13:51:10 +01:00
Matej Ferencevic
eb38b4f373 Rename Bolt flags
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2587
2019-12-09 11:24:09 +01:00
Matej Ferencevic
1aadebbb70 Migrate leftover tests away from old storage
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2590
2019-12-09 10:27:35 +01:00
Matej Ferencevic
dd68065d34 Remove leftover config files
Summary:
Don't use flag files for specifying flag values in tests. Instead, all
necessary flags are explicitly defined in each of the tests.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2588
2019-12-09 10:25:43 +01:00
Teon Banek
d9abb7ccf1 Move FindProcedure to module.hpp
Summary:
The function will also be used during AST construction in order to
support `CALL ... YIELD *` syntax.

Reviewers: mferencevic, ipaljak

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2586
2019-12-09 10:03:23 +01:00
Matej Ferencevic
8da71873a7 Remove statsd
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2585
2019-12-06 16:44:30 +01:00
Matej Ferencevic
8a0abd6dbd Make memgraph with storage v2 the main binary
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: buda, pullbot

Differential Revision: https://phabricator.memgraph.io/D2567
2019-12-06 10:51:16 +01:00
Teon Banek
c8db7f88dc Move mg.reload procedures to the builtin module
Reviewers: mferencevic, ipaljak

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2584
2019-12-05 13:54:22 +01:00
Matej Ferencevic
f786daf769 Install auth modules and their configuration files
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2536
2019-12-05 10:29:10 +01:00
Matej Ferencevic
db531611a9 Fix garbage collector race condition in storage v2
Summary:
The garbage collector had a race condition when it would delete deltas that
were in the middle of an object's delta chain. In the process of deleting
(unlinking) the delta, the garbage collector previously wouldn't acquire any
locks. That operation was then racing with the standard MVCC
`CreateAndLinkDelta` function that adds a new delta into the chain.
Fortunately, `CreateAndLinkDelta` always does its modifications while holding a
lock to the owner of the chain (either a vertex or an edge) so this change just
adds the lock acquiring to the garbage collector.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2582
2019-12-05 10:22:21 +01:00
Ivan Paljak
4b5d30cfb5 Incorporate edge weights into louvain query module
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: mferencevic, pullbot

Differential Revision: https://phabricator.memgraph.io/D2583
2019-12-04 16:22:14 +01:00
Matej Ferencevic
9cc204793d Remove copy constructor/assignment from utils::SpinLock
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2581
2019-12-04 14:08:58 +01:00
Teon Banek
0d979dd7b3 query/procedure: Add builtin mg.procedures
Reviewers: mferencevic, ipaljak

Reviewed By: mferencevic, ipaljak

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2579
2019-12-04 13:03:25 +01:00
Matej Ferencevic
83c368c82b Fix indices locking in storage v2
Summary:
The functions that previously had locks in them are always called while the
vertex lock is already being held. Also, the lock guards were implemented
incorrectly.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2580
2019-12-04 10:27:55 +01:00
Matej Ferencevic
10cc831ed2 Implement all edge filters for storage v2
Summary:
Edge filters (edge type and destination vertex) are now handled natively in the
storage API. The API is implemented to be the fastest possible when using the
filters with the assumption that the number of edge types will be small.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2576
2019-12-04 10:13:28 +01:00
Ivan Paljak
f6b6ea254d Implement Louvain as a query module
Reviewers: teon.banek, dsantl

Reviewed By: teon.banek, dsantl

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2574
2019-12-03 16:18:24 +01:00
Ivan Paljak
e605aed497 Implement weakly connected components as a query module
Reviewers: teon.banek, dsantl

Reviewed By: teon.banek, dsantl

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2577
2019-12-03 13:11:40 +01:00
Ivan Paljak
7cb4c64a48 Fix bug in query module result validation
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2578
2019-11-28 16:38:12 +01:00
Teon Banek
dd30522b2a Update mgp_result_new_record documentation
Reviewers: mferencevic, ipaljak

Reviewed By: ipaljak

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2575
2019-11-28 14:58:46 +01:00
Teon Banek
e31331aae4 Rework CallProcedure to validate result sets
Summary:
This diff renames `__reload__` procedure to be `mg.reload` accepting a
module name. The main CallCustomProcedure function is now split into
multiple parts, so that there's more control over finding a procedure,
type checking its arguments and finally checking the returned result
set.

Depends on D2572

Reviewers: mferencevic, ipaljak

Reviewed By: ipaljak

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2573
2019-11-28 14:58:43 +01:00
Teon Banek
d71f1bfa35 Type check procedure arguments in CALL clause
Summary: Depends on D2571

Reviewers: mferencevic, ipaljak

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2572
2019-11-28 14:58:36 +01:00
Teon Banek
e1399582b8 Implement SatisfiesType on CypherType classes
Reviewers: mferencevic, ipaljak

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2571
2019-11-28 14:58:34 +01:00
Matej Ferencevic
c5def558e8 Cache vertex accessor for all vertices iterable
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2569
2019-11-27 10:55:12 +01:00
Teon Banek
df6ce53c67 query/procedure: Expose vertex ID through C API
Reviewers: mferencevic, ipaljak

Reviewed By: ipaljak

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2568
2019-11-26 17:06:31 +01:00
Ivan Paljak
03ecc58715 Make the Louvain code comply with our conventions
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: buda, pullbot

Differential Revision: https://phabricator.memgraph.io/D2566
2019-11-26 10:06:19 +01:00
Matej Ferencevic
9e04183be7 Implement query execution timeout
Summary:
The query execution now has a timeout for each Cypher query it executes. The
timeout is implemented using TSC and will work only when TSC is available (same
as PROFILE). TSC is used to mitigate the performance impact of reading the
current time constantly.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2562
2019-11-25 17:45:40 +01:00
Teon Banek
673ebf428c Add functions for treating character strings as byte strings
Reviewers: mferencevic, ipaljak

Reviewed By: mferencevic, ipaljak

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2565
2019-11-25 17:03:12 +01:00
Ivan Paljak
7467d52d5b Add cmake files and a dummy louvain query module
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2561
2019-11-25 16:38:56 +01:00
Matej Ferencevic
fc146a71e0 Migrate tests to storage v2 part 3
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2560
2019-11-25 16:21:04 +01:00
Matej Ferencevic
8a94b16e79 Fix parameters for PROFILE queries
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2563
2019-11-25 11:05:47 +01:00
Matej Ferencevic
42a4f310ff Reduce number of copies in query::Parameters
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2564
2019-11-25 11:00:55 +01:00
Teon Banek
3c615759b6 Type check values used for indexed lookup in range
Reviewers: mferencevic, ipaljak

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2558
2019-11-22 10:28:01 +01:00
Matej Ferencevic
f61a8c3358 Migrate tests to storage v2 part 2
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2559
2019-11-22 10:21:30 +01:00
Matej Ferencevic
9cc10e131d Migrate tests to storage v2 part 1
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2554
2019-11-21 19:00:32 +01:00
Ivan Paljak
ae0be9032e Implement Louvain community detection algorithm
Summary: Louvain implementation according to original paper.

Reviewers: dsantl

Reviewed By: dsantl

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2556
2019-11-21 15:06:30 +01:00
Matej Ferencevic
29590f1112 Implement edge iteration with known destination
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2553
2019-11-21 11:58:12 +01:00
Teon Banek
019b6cddaa Use a custom value printer for procedure signature
Reviewers: mferencevic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2557
2019-11-21 11:17:00 +01:00
Teon Banek
5354a11a00 Add registering multiple procedures in query modules
Reviewers: mferencevic, dsantl, ipaljak

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2551
2019-11-21 10:13:09 +01:00
Matej Ferencevic
8be2b4af63 Remove output formatters from vertex/edge accessors
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2555
2019-11-20 20:12:19 +01:00
Matej Ferencevic
d5f02c5ef8 Fix label+property index iteration in v2
Summary:
Now when iterating over a label+property index the index verifies that the
bounds meet the criteria imposed by openCypher.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2552
2019-11-18 14:54:45 +01:00
Teon Banek
1dc97a37f8 Cache globally allocated mgp_type instances
Summary:
This simplifies the C API and reduces total allocations done when
constructing a type.

Reviewers: mferencevic, ipaljak

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2550
2019-11-15 10:44:55 +01:00
Matej Ferencevic
d17d463884 Add NONEXISTENT_OBJECT error to storage v2
Summary:
Previously, when accessing the labels/properties/edges of a vertex/edge that
was just created the NEW view would correctly display the change, but the OLD
view would be invalid and would crash the database. With this change the OLD
view of a freshly created vertex/edge won't cause a crash, but will instead
report an error.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2549
2019-11-15 10:01:22 +01:00
Matej Ferencevic
40ae31e9a0 Remove manual/repl test
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2548
2019-11-13 16:32:45 +01:00
Teon Banek
edaa03a960 Expose explicit Label index creation through Cypher
Reviewers: mferencevic, ipaljak

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2547
2019-11-13 16:28:14 +01:00
Teon Banek
9c095501d8 query/procedure: Add type system for Cypher
Summary:
The type system is modelled after "CIP2015-09-16"
https://github.com/opencypher/openCypher/blob/master/cip/1.accepted/CIP2015-09-16-public-type-system-type-annotation.adoc

This is needed for registering procedures and their signatures. The
users will be able to specify what a custom procedure accepts and
returns. All of this needs to be available for inspection during
runtime. Therefore, this diff implements printing types as a user
presentable string. In the future, we will probably want to add type
checking through these types, because openCypher requires type checking
on values passed in and returned from custom procedures.

Reviewers: mferencevic, ipaljak, dsantl

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2544
2019-11-13 14:24:21 +01:00
Teon Banek
b4df6ba0a9 Correctly prepare Explain and Profile
Summary: Also test Explain and Profile through Intepreter.

Reviewers: mferencevic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2546
2019-11-13 12:03:11 +01:00
Matej Ferencevic
329818b1b0 Make the Cypher dumper a function
Summary:
The dumper is now a function and doesn't have to worry about any state. The
function streams the Cypher queries directly to the client. This diff also
makes the dumper work with storage v2.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2545
2019-11-12 16:01:29 +01:00
Matej Ferencevic
e4edb2be99 Finalize storage v2 index API
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2543
2019-11-12 12:11:38 +01:00
Matej Ferencevic
205477b28a Implement indices and constraints info for v2
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2542
2019-11-12 11:06:53 +01:00
Lovro Lugovic
8735082bbd Don't use OutputTable within query handlers
Reviewers: teon.banek, mferencevic

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2541
2019-11-11 14:12:38 +01:00