Commit Graph

1500 Commits

Author SHA1 Message Date
Dominik Gleich
1556d78d15 Update snapshot format
Summary:
Set vertex/edge generator id from recovery

Add tests

Reviewers: florijan

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1061
2017-12-20 16:57:42 +01:00
Marin Tomic
20aa8d563a Implement RaftNetworkInterface via RPC
Summary:
Add missing fields in RequestVote RPC

Unnest Raft RPC requests and responses

Make RPC request and reply serializable

Refactor Raft network interface

Implement RPC retrying with backoff period

Add cerealization functions for optional

Add RPC network interface for raft

Add some comments and documentation

Add manual test for RPC network interface

Remove raft reactor experiments

Reviewers: mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot, mculinovic

Differential Revision: https://phabricator.memgraph.io/D1066
2017-12-20 16:48:46 +01:00
florijan
312016ca31 Support both locally and system installed libboost
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1071
2017-12-20 16:13:03 +01:00
Teon Banek
5f7837d613 Serialize Ast classes
Summary:
Although the first solution used cereal, the final implementation uses
boost. Since the cereal is still used in the codebase, compilation has
been modified to support multithreaded cereal.

In addition to serializing Ast classes, the following also needed to be
serialized:

  * GraphDbTypes
  * Symbol
  * TypedValue

TypedValue is treated specially, by inlining the serialization code in
the Ast class, concretely PrimitiveLiteral.

Another special case was the Function Ast class, which now stores a
function name which is resolved to a concrete std::function on
construction.

Tests have been added for serialized Ast in
tests/unit/cypher_main_visitor

Reviewers: mferencevic, mislav.bradac, florijan

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1067
2017-12-20 13:28:34 +01:00
florijan
3ae45e0d19 Add master/worker flags, main functions and coordination
Reviewers: dgleich, mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1060
2017-12-19 16:05:57 +01:00
florijan
37722e54b3 Add RPC to concurrent ID mapper
Summary:
The distributed ID mapper is not yet utilised in GraphDb as those
changes are in D1060. Depending on landing order it will be added.

Reviewers: dgleich, mislav.bradac

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1064
2017-12-19 09:11:16 +01:00
Dominik Gleich
0eb30db8db Remove executor not run option
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1062
2017-12-18 14:36:15 +01:00
Teon Banek
f0469ba634 Bump Memgraph version to 0.9
Reviewers: mferencevic, buda

Reviewed By: mferencevic

Differential Revision: https://phabricator.memgraph.io/D1063
2017-12-18 10:37:31 +01:00
Marin Tomic
5b7cb4602c Add simple client facing API for RaftMember
Summary:
Implement AddComand method on RaftMember

Move RPCType out of rpc request and reply

Add unit test for AddCommand

Reviewers: mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot, mculinovic

Differential Revision: https://phabricator.memgraph.io/D1042
2017-12-18 07:32:39 +01:00
Matej Ferencevic
49bea9b0d0 Report clang-format errors
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1059
2017-12-15 11:52:19 +01:00
Matej Ferencevic
a355bf4e77 Remove obsolete scripts
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1047
2017-12-15 10:48:38 +01:00
Dominik Gleich
47dab02c2d Update changelog
Reviewers: buda

Reviewed By: buda

Differential Revision: https://phabricator.memgraph.io/D1058
2017-12-15 10:36:32 +01:00
florijan
b42169a0cb Fix RPC pimp iwyu
Reviewers: dgleich

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1055
2017-12-14 16:34:07 +01:00
Marko Culinovic
0cc1ac92b0 Add TED Talk example to quick start
Reviewers: teon.banek, florijan, mtomic, buda

Reviewed By: teon.banek, buda

Subscribers: mferencevic, pullbot

Differential Revision: https://phabricator.memgraph.io/D1022
2017-12-14 13:48:07 +01:00
Dominik Gleich
0f1e8aa763 Add rpc server local thread
Summary: Update tests for new rpc server

Reviewers: mislav.bradac, florijan, mferencevic

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1057
2017-12-14 13:37:32 +01:00
florijan
52b3941c8a Fix tx::WorkerEngine flakyness. Change Endpoint::port type.
Reviewers: mislav.bradac, dgleich

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1054
2017-12-14 10:36:24 +01:00
Matija Santl
2758b35c08 Fix semicolon in column name
Summary:
Special casing the last token when adding it to the named expression list.
Added a test to check this case.

Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1052
2017-12-14 09:44:21 +01:00
Dominik Gleich
a8488ac497 Rpc client locking
Summary:
Rpc client wasn't thread safe and required a lock before each rpc call.
The locking functionality is now incorporated in Rpc client.

Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Differential Revision: https://phabricator.memgraph.io/D1056
2017-12-13 17:37:32 +01:00
Dominik Gleich
581404a7b6 Make index creation fully parallel
Summary:
Testing on following operations:

UNWIND RANGE(0,1000000) AS _ CREATE (n: Node {a: 1.0, b:2.0});
CREATE INDEX ON :Node(a);
CREATE INDEX ON :Node(b);

Before:
~32sec

After:
~18sec

Reviewers: mislav.bradac, florijan

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1041
2017-12-13 16:50:56 +01:00
Matija Santl
4da8312abe Fix query returning a map
Summary: Add curvy braces handling in `QueryStripper` and an accompanying test for it.

Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1051
2017-12-13 15:38:20 +01:00
Mislav Bradac
27370b99ff Fix Pattern::Accept
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1048
2017-12-13 13:15:22 +01:00
Mislav Bradac
cf7d9070d8 Fix flakyness in rpc/messaging tests
Summary: In this diff I just wanted to fix tests' flakyness. We can discuss if we want to always pass endpoint as an argument and never pass address:port pair explicitly. However if we decide that, I will do that change in another diff.

Reviewers: dgleich, florijan

Reviewed By: dgleich, florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1049
2017-12-13 13:15:02 +01:00
Dominik Gleich
19e96c98b6 Generalize cereal message macro
Reviewers: florijan

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1053
2017-12-13 12:53:15 +01:00
Matija Santl
9ad7d82a54 Implement UNION query combinator
Summary:
Union query combinator implementation consists of:
 * adjustments to the AST and `cypher_main_visitor`
 * enabling `QueryStripper` to parse multiple `return` statements (not stopping after first)
 * symbol generation for union results
 * union logical operator
 * query plan generator adjustments

Reviewers: teon.banek, mislav.bradac

Reviewed By: teon.banek

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D1038
2017-12-13 09:54:00 +01:00
Matej Ferencevic
dae79413bf Increase cppcheck timeout
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1046
2017-12-12 20:14:30 +01:00
Marko Culinovic
52a9be3cc8 Add examples to installation
Summary:
Examples are added in release/examples directory. Each example
must have its own directory with populate.cyp file inside it.
This file contains graph creation queries written in OpenCypher.
When memgraph is built, database snapshots for each example are
created in release/examples/build directory. During memgraph
installation these snapshots are copied to share/memgraph/examples.

Reviewers: teon.banek, mferencevic

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1036
2017-12-12 14:59:54 +01:00
Mislav Bradac
eb272f0b67 Assert on endpoint failures
Summary: .

Reviewers: mferencevic, florijan

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1045
2017-12-12 14:27:24 +01:00
Teon Banek
0d40f6a759 Merge memgraph_link_target into memgraph executable target
Summary:
Memgraph's executable target is unnecessarily complicated by having a
name which depends on the commit hash and build type. It is now renamed
to simply 'memgraph', while the executable output uses the encoding of
commit hash and build type as the name. This simplifies the dependency
handling in cmake, where now the full path to the executable can be
easily obtained by using the generator expression:
`$<TARGET_FILE:memgraph>`.

In addition to the above simplification, memgraph_link_target is now
replaced with a post build step on memgraph target itself. This
guarantees that the symlink always exists after building the executable,
as well as simplify the make invocation. The invocation now boils down
to `make memgraph` instead of `make memgraph_link_target`.

Reviewers: mferencevic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1043
2017-12-11 16:11:19 +01:00
Teon Banek
8d356d3f9e Add introductory chapters from Phabricator wiki
Summary:
Add quick start document for new developers.
Add developer documentation for C++ code style.
Add git and arc workflow document.

This is the first step in moving parts of the documentation related to
development from Phabricator wiki to git tracked markdown files. Most of
the changes here overhaul the text from the wiki, to make it more
friendly for new developers.

Markdown uses the Github flavored extensions, and should easily
be converted to any other document using `pandoc`.

Reviewers: buda, msantl, mculinovic, mtomic

Reviewed By: mtomic

Subscribers: mislav.bradac

Differential Revision: https://phabricator.memgraph.io/D1031
2017-12-11 15:04:31 +01:00
Marin Tomic
6b4a2cafc5 Fix OnRequestVote RPC callback
Summary: RPC recipient should update its term even if it is rejecting the request.

Reviewers: mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1039
2017-12-11 12:53:17 +01:00
florijan
4982d45e27 Add RPC to distributed tx::Engine
Reviewers: mislav.bradac, dgleich

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1035
2017-12-11 11:05:01 +01:00
Dominik Gleich
eb1adccf40 Fix compilation
Reviewers: teon.banek, mislav.bradac, mferencevic

Reviewed By: teon.banek

Differential Revision: https://phabricator.memgraph.io/D1040
2017-12-11 10:40:50 +01:00
Marin Tomic
0bf692f8ec Refactor Raft leader election to use multiple threads
Summary:
Implement log replication

Rebase and fix src/CMakeLists.txt

Some style fixes

Changed shared_ptr to unique_ptr for RaftPeerState

Change Id and Leader to const

Move implementation to separate class

Fix raft_experiments.cpp

Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1033
2017-12-08 16:30:57 +01:00
florijan
381faf9dd4 Fix durability test flakyness
Reviewers: dgleich

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1037
2017-12-08 15:16:49 +01:00
florijan
f5c0455af4 Prepare record accessor for distributed
Summary:
What's done:
- `RecordAccessor` can represent remote data
- `GraphDbAccessor` manages remote data
- Cleanup: different `EdgeAccessor lazyness (@dgleich: take a look), unused methods, documentation...
- `TODO` placeholders for remote implementation

What's not done:
- RPC and data transfer
- how exactly remote errors are handled
- not sure if any MVCC Record info for remote data should be tracked
- WAL and RPC Deltas properly handled (Gleich working on extracting `Wal::Op`)

This implementation should not break single-node execution, and should provide good abstractions and placeholders for distributed. Once that's satisfied, it should land.

Reviewers: dgleich, buda, mislav.bradac

Reviewed By: dgleich

Subscribers: dgleich, pullbot

Differential Revision: https://phabricator.memgraph.io/D1030
2017-12-08 14:12:18 +01:00
Dominik Gleich
03db948d7e Refactor operations into StateDeltas
Summary: Operations are moved and renamed from WAL to a separate file in preparation for HA and distributed storage.

Reviewers: florijan, mtomic, mislav.bradac

Reviewed By: florijan

Subscribers: mislav.bradac, pullbot

Differential Revision: https://phabricator.memgraph.io/D1034
2017-12-07 14:23:41 +01:00
florijan
b1cfe46c4a Configure YCM for Cereal
Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Differential Revision: https://phabricator.memgraph.io/D1032
2017-12-06 14:28:34 +01:00
Marko Culinovic
be9fe9fe75 Fix graph creation in tck
Summary:
Parsing query with string values wasn't correct. It didn't matter
with which type of quote mark string value started. It simply took
any possible quote mark which wasn't escaped as possible beginning
or end for string value.

Following example didn't work:
{name: "Chris Anderson: Technology's long tail"}

Detected string value was "Chris Anderson: Technology' and because
of that query broke. Now, string is detected by memorizing which
quote mark was used to start parsing string value and is required
to end string value with that quote mark.

Reviewers: teon.banek, msantl

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1029
2017-12-06 09:05:31 +01:00
Mislav Bradac
73c01cfb73 Reuse sessions in bipartite
Reviewers: florijan, mferencevic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1028
2017-12-05 15:55:35 +01:00
Mislav Bradac
60f4db2b9f Add first version of message passing and rpc
Reviewers: mtomic, buda

Reviewed By: mtomic, buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1002
2017-12-05 14:51:18 +01:00
Teon Banek
8dcd8e1012 Cleanup libs before running libs/setup in init script
Summary:
Since libs/setup tries to preserve any local additions to libs
directory, any failure in doing that would cause the init script to be
left in an unfinished state. This could cause problems when rerunning
the init. In such cases, we want to completely cleanup the libs
directory and start again.

Anyone who wishes only to update the libs and preserve local additions
should manually run libs/setup.

Reviewers: mferencevic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1026
2017-12-05 13:18:48 +01:00
Teon Banek
c0cd9bd22b Use correct snapshot directory in mg_import_csv
Reviewers: florijan, mferencevic

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1025
2017-12-05 13:18:17 +01:00
Dominik Gleich
3ddbcad0d9 Refactor global ids and prepare for distributed
Summary:
Change ids to global ids

Fix tests

Reviewers: florijan, buda

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1019
2017-12-05 13:05:55 +01:00
florijan
e218bc1c69 Improve utils::RandomString
Reviewers: dgleich

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1023
2017-12-05 10:10:36 +01:00
Matej Ferencevic
3c6306985d Link macro benchmark runs together
Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1024
2017-12-05 10:06:05 +01:00
Teon Banek
a17261038c Include tools CMakeLists in the top level CMakeLists
Summary:
Split main CMakeLists into src/CMakeLists

The main CMakeLists duty is to make all the required libraries and
variables visible to all of the other sub-CMakeLists. After doing that,
it should include those sub-CMakeLists according to configuration
options.

This should make global configurations easier to reuse without polluting
the global space with locally related configurations. It is a necessary
step for including other projects like 'tools' in the release
installation.

Building tools is automatically disabled, but can be enabled by setting
the TOOLS option to ON when running cmake. This should allow on demand
building as well as combined installation of Memgraph and its tools.

Reviewers: mferencevic, buda

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1018
2017-12-04 15:18:18 +01:00
florijan
d1dbf22cd1 Prepare ConcurrentIdMapper for distributed
Reviewers: dgleich

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1017
2017-12-04 14:06:05 +01:00
florijan
e26456d5ad Fix durability test flakyness
Summary:
It occurred that part of the durability flakyness test might be that the
same durability directory is used always. If the test is run
simultaneously on a single system, there will be interference.

This might not actually fix all the flakyness :(

I also made the `utils::RandomString` function since that's now used in
multiple places, tested it etc.

Reviewers: buda, dgleich

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1020
2017-12-04 13:46:56 +01:00
Teon Banek
a799351eb0 Correctly inspect property filters during planning
Summary:
This change generates multiple PropertyFilters for expressions such as
`n.prop1 = m.prop2`. When choosing one PropertyFilter, we want to also
remove the other one, because they represent the same original
expression.  Therefore, the removal is no longer based on FilterInfo
equality, but on the original expression equality. Additionally,
FilterInfo and PropertyFilter equality operators have been removed to
avoid any pretense they do what you expect or want.

Reviewers: florijan, msantl

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1021
2017-12-04 09:57:41 +01:00
florijan
ce3638b25e Prepare transactional engine for distributed
Summary:
The current idea is that the same MG binary can be used for single-node,
distributed master and distributed worker. The transactional engine in
the single-node and distributed master is the same: it determines the
transactional time and exposes all the "global" functionalities. In the
distributed worker the "global" functions must contact the master.

Reviewers: dgleich, mislav.bradac, buda

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1013
2017-12-01 09:17:44 +01:00