Commit Graph

2185 Commits

Author SHA1 Message Date
Ivan Paljak
8e796e9fd1 Fix infinite wait in leader election.
Reviewers: msantl

Reviewed By: msantl

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1763
2018-12-11 10:35:35 +01:00
Matija Santl
f501980973 Wire raft into memgraph pt.1.
Summary:
This is just the first diff that tries to wire the raft protocol into
memgraph.

In this diff I'm introducing transaction engine reset functionality. I also
introduced `RaftInterface` which should be used wherever someone wants to access
Raft from Memgraph.

For design decisions see the feature spec.

Reviewers: ipaljak, teon.banek

Reviewed By: ipaljak

Subscribers: pullbot, teon.banek

Differential Revision: https://phabricator.memgraph.io/D1758
2018-12-10 17:08:36 +01:00
Teon Banek
26d23959d3 Serialize C++ part of query folder via SLK
Reviewers: mtomic, mferencevic, llugovic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1761
2018-12-10 14:29:28 +01:00
Ivan Paljak
d637629078 Implement Raft RPC, log serialization for disk storage and leader election
Summary: This diff contains a rough implementation of the Raft protocol which ends at leader election.

Reviewers: msantl

Reviewed By: msantl

Subscribers: teon.banek, pullbot

Differential Revision: https://phabricator.memgraph.io/D1744
2018-12-10 12:49:22 +01:00
Teon Banek
f5b39cfc41 Serialize storage and durability via SLK
Reviewers: mferencevic, msantl, ipaljak

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1759
2018-12-07 14:26:12 +01:00
Matej Ferencevic
e70ac03607 Remove inheritance from storage types
Reviewers: teon.banek, msantl

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1757
2018-12-07 11:03:22 +01:00
Teon Banek
7638b09867 Generate SLK serialization from LCP
Summary:
Classes marked with `:serialize (:slk)` will now generate SLK
serialization code. This diff also changes how the `:serialize` option
is parsed, so that multiple different serialization backends are
supported.

Reviewers: mtomic, llugovic, mferencevic

Reviewed By: mtomic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1755
2018-12-05 14:58:39 +01:00
Matej Ferencevic
eabd832048 Remove vtable from TotalOrdering
Summary: This change undoes the performance impact that was introduced in D1117

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1756
2018-12-05 09:46:18 +01:00
Teon Banek
7a8e6b52e0 Implement LCP class serialization for SLK
Summary:
This should cover the minimum required feature set for generating the
serialization code for SLK. There are some TODO comments, mostly
concerning quality of life improvements. The documentation on LCP has
been updated.

Additionally, any previous CHECK which would trigger if loading went
wrong is now replaced by raising SlkDecodeException. Other assertions of
code misuse are left as CHECK invocations.

Reviewers: mtomic, llugovic, mferencevic

Reviewed By: mtomic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1754
2018-12-04 12:54:58 +01:00
Matej Ferencevic
e92036cfcc Refactor QA
Reviewers: teon.banek, buda, mculinovic

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1752
2018-12-04 12:33:48 +01:00
Teon Banek
8b1aa3c2b6 Block default load of polymorphic types from a pointer in SLK
Summary:
Serialization of std::unique_ptr and std::shared_ptr now requires a
custom callback for handling the concrete element that is pointed to.
We use C++ type trait which checks whether the we are using a
polymorphic type --- class that has at least 1 virtual function. This
obviously doesn't work with pointers to base classes of hierarchies
without virtual member functions. But we don't use that kind of
inheritance, why would we, right? :)

(Luckily the breaking case isn't serialized, and hopefully never will
be. Perhaps we fix such inheritance in the future.)

Reviewers: mferencevic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1753
2018-12-04 11:07:01 +01:00
Teon Banek
b995dac623 Serialize Endpoint via SLK
Reviewers: mferencevic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1751
2018-12-03 09:32:25 +01:00
Matej Ferencevic
22824fd83c Simplify snapshot and WAL filenames
Reviewers: teon.banek, msantl

Reviewed By: msantl

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1669
2018-11-30 22:04:06 +01:00
Matej Ferencevic
809e1779b1 Fix BFS subcursor cleanup
Reviewers: mtomic, teon.banek

Reviewed By: mtomic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1748
2018-11-30 22:02:38 +01:00
Marin Tomic
d819c7b48c Make analyze_rpc_calls script work with new TypeInfo
Reviewers: mferencevic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1750
2018-11-27 15:02:53 +01:00
Teon Banek
2453b1582c Serialize RecoveryInfo and RecoveryData via SLK
Reviewers: mferencevic, msantl

Reviewed By: msantl

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1749
2018-11-27 14:59:38 +01:00
Marin Tomic
11bf7d3b31 Fix logging in RPC
Summary: Starting memgraph with logging verbosity level 12 would crash memgraph, because extended and regular callbacks were not properly differentiated in logging.

Reviewers: mferencevic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1747
2018-11-23 14:16:48 +01:00
Matija Santl
b647e3f8b8 Prepare memgraph for HA
Summary:
Removed WAL and WAL recovery from single node ha binary.
Added `LogEntryBuffer` in `RaftServer`.

Reviewers: ipaljak, teon.banek

Reviewed By: ipaljak, teon.banek

Subscribers: teon.banek, pullbot

Differential Revision: https://phabricator.memgraph.io/D1739
2018-11-22 15:07:39 +01:00
Teon Banek
7d01ba5178 Use generic :dont-save mechanism in LCP
Summary:
It doesn't make sense to tie skipping a member for serialization to a
particular serialization implementation.

Reviewers: mtomic, llugovic

Reviewed By: mtomic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1743
2018-11-22 10:01:38 +01:00
Teon Banek
14c9044909 Convert symbol.hpp to LCP
Summary:
With quite frequent changes of serialization backend, it's getting
really painful updating the C++ implementation. This diff defines the
Symbol class via LCP, so that the C++ serialization is generated instead
of written by hand.

Reviewers: mtomic, llugovic

Reviewed By: mtomic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1741
2018-11-22 09:52:18 +01:00
Matija Santl
dd6fe013dc Parse raft config
Summary:
Added command line parameters to specify rpc flags, raft and
coordination config files and current server id.

Reviewers: ipaljak, teon.banek

Reviewed By: ipaljak, teon.banek

Subscribers: pullbot, teon.banek

Differential Revision: https://phabricator.memgraph.io/D1742
2018-11-21 17:34:13 +01:00
Teon Banek
6dbe054bdc Remove including query in durability
Reviewers: msantl, ipaljak, mferencevic

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1740
2018-11-21 15:27:51 +01:00
Teon Banek
a75008f94b Support SLK serialization of enums in LCP
Reviewers: mtomic, llugovic, mferencevic

Reviewed By: mtomic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1737
2018-11-21 13:28:41 +01:00
Ivan Paljak
73da1e4463 Add Raft skeleton
Reviewers: msantl

Reviewed By: msantl

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1732
2018-11-19 13:21:58 +01:00
Teon Banek
58b450a2ea Remove template from ExpandUniquenessFilter
Summary:
Instantiation with VertexAccessor was never used, so the template
needlessly complicated the rest of the codebase.

Reviewers: mtomic, llugovic

Reviewed By: mtomic

Subscribers: mferencevic, pullbot

Differential Revision: https://phabricator.memgraph.io/D1736
2018-11-19 13:03:39 +01:00
Teon Banek
8ed1fbbbe1 Generate TypeInfo object for all LCP defined classes
Summary:
TypeInfo will be needed for upcoming serialization via SLK. This diff
changes the already defined TypeInfo by removing the reliance on
capnp::typeId calls. The struct itself is now in utils.

Hopefully, this shouldn't break our RPC stack due to new ID generation.

Reviewers: mferencevic, mtomic, llugovic

Reviewed By: mtomic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1735
2018-11-16 13:27:58 +01:00
Teon Banek
a272fa2e6b Add basic support for saving classes with SLK
Summary:
This is the initial work on transferring our serialization code from
Cap'n Proto to SaveLoadKit. The commit contains tests for generated
code, but still requires work on supporting some features. Most notably,
generating and storing type IDs for derived classes so that they can be
loaded from a base pointer. Naturally, loading implementation hasn't
even been started yet.

Reviewers: mtomic, llugovic, mferencevic

Reviewed By: mtomic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1733
2018-11-15 13:26:38 +01:00
Vinko Kasljevic
b77d186f58 Add storage stat for single node
Summary:
GraphDb now has GetStorageStat method that returns live view to
object containing vertex_count, edge_count and avg_degree().
Stat is updated on each garbage collection run and represents number of
objects that are visible to any transaction.

Reviewers: teon.banek, msantl, ipaljak

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1731
2018-11-15 11:53:03 +01:00
Dino Santl
d3634e9a39 Add SmallVector and tests
Summary: SmallVector data structure introduction.  This is the first step. In this revision are SmallVector implementation and tests. The second step will be swapping std::vector with SmallVector in the current codebase.

Reviewers: teon.banek, buda, ipaljak, mtomic

Reviewed By: teon.banek, ipaljak

Subscribers: ipaljak, pullbot

Differential Revision: https://phabricator.memgraph.io/D1730
2018-11-14 15:04:12 +01:00
Ivan Paljak
7f44b895b4 Add Raft RPC messages
Summary:
Basic RPC messages for Raft protocol. They will most likely be updated as we
move along with the implementation.

Reviewers: msantl, teon.banek, mferencevic

Reviewed By: msantl, teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1726
2018-11-12 14:24:23 +01:00
Matija Santl
54fa46541e Serialize StateDelta for HA
Summary:
Since we need to send `StateDelta`s over the wire in HA, we need to be
able to serialize those bad boys.
This diff hopefully does this the right way.

Reviewers: teon.banek, mferencevic, ipaljak

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1725
2018-11-12 13:36:11 +01:00
Matej Ferencevic
6d21e58b09 Add ClientPool and ThreadPool tests to RPC benchmark
Summary: Add script for plotting throughput

Reviewers: teon.banek, mculinovic, buda

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1721
2018-11-12 13:05:37 +01:00
Teon Banek
5df4d55ec1 Extract QueryVisitor from HierarchicalTreeVisitor
Summary:
This change makes HierarchicalTreeVisitor visit only Cypher related AST
nodes. QueryVisitor can be used to differentiate between various query
types we have. The next step is to either rename HierarchicalTreeVisitor
to something like CypherQueryVisitor, or perhaps extract Clause visiting
from it.

Reviewers: mtomic, llugovic

Reviewed By: llugovic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1710
2018-11-12 12:53:25 +01:00
Matej Ferencevic
bbe095d41a Improve serialization benchmark
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1729
2018-11-12 12:20:02 +01:00
Matej Ferencevic
2c354e82f3 Add support for PropertyValue to SLK
Summary:
Improve tests
Add exceptions

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1727
2018-11-12 11:20:15 +01:00
Ivan Paljak
45098dd80b Update Raft feature spec (no-op in reads)
Reviewers: msantl, teon.banek, buda, mtomic, mferencevic

Reviewed By: msantl

Differential Revision: https://phabricator.memgraph.io/D1728
2018-11-12 10:49:22 +01:00
Marin Petricevic
20dcb05c50 Add Tensorflow op feature spec
Reviewers: buda, teon.banek, mferencevic, msantl

Reviewed By: buda, teon.banek

Differential Revision: https://phabricator.memgraph.io/D1691
2018-11-08 11:17:20 +01:00
Matej Ferencevic
4ad9cfe1f4 Fix distributed tests exit code
Reviewers: teon.banek, msantl

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1499
2018-11-07 22:46:55 +01:00
Matej Ferencevic
cc8f199a5f Reduce distributed tests flakiness
Summary:
The single-binary distributed tests didn't wait for the whole cluster to be up
and running before they started running their tests. Now all tests ensure that
all workers are registered to the master and all other workers before starting
any tests.

Reviewers: mculinovic

Reviewed By: mculinovic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1724
2018-11-07 19:27:28 +01:00
Lovro Lugovic
06d4568950 Add ExpressionPrettyPrinter
Reviewers: teon.banek, mtomic

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1719
2018-11-07 13:06:14 +01:00
Vinko Kasljevic
7ba8228c46 Refactor storage file structure
Summary:
- Create types folder in storage/common
- Move locking and kvstore to storage/common
- Add storage/distributed/rpc folder

Reviewers: teon.banek, ipaljak, msantl

Reviewed By: msantl

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1713
2018-11-06 18:17:31 +01:00
Matej Ferencevic
f923e7f7cb Remove wrongly committed files
Summary: Add file to .gitignore

Reviewers: msantl

Reviewed By: msantl

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1722
2018-11-06 16:49:48 +01:00
Matej Ferencevic
31d31cf4b9 Fix parallel macro benchmarks
Reviewers: mculinovic

Reviewed By: mculinovic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1723
2018-11-06 16:49:12 +01:00
Matej Ferencevic
2cbe97d7c2 Implement RPC benchmark
Reviewers: teon.banek, mculinovic, buda

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1720
2018-11-05 10:45:43 +01:00
Teon Banek
08c14bfafc Split C++ meta information types to a new file
Reviewers: mtomic, llugovic

Reviewed By: llugovic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1716
2018-11-05 09:37:09 +01:00
Teon Banek
cf19bbad8f Add basic indentation to vim-lcp plugin
Reviewers: mtomic, mferencevic, msantl, buda

Reviewed By: msantl

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1718
2018-10-31 15:37:42 +01:00
Matija Santl
4f0a7df4bb Fix unique constraint recovery
Summary:
See https://app.asana.com/0/743890251333732/888297761596047/f for more details.

# BEFORE
```
Note: Google Test filter = *UniqueConstraintRecovery*
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from Durability
[ RUN       ] Durability.UniqueConstraintRecovery
unknown file: Failure
C++ exception with description "Index couldn't be created due to constraint
violation!" thrown in the test body.
[  FAILED   ] Durability.UniqueConstraintRecovery (3 ms)
[----------] 1 test from Durability (3 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (3 ms total)
[  PASSED   ] 0 tests.
[  FAILED   ] 1 test, listed below:
[  FAILED   ] Durability.UniqueConstraintRecovery

 1 FAILED TEST
 ```

# AFTER

 ```
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from Durability
[ RUN       ] Durability.UniqueConstraintRecovery
[       OK  ] Durability.UniqueConstraintRecovery (4 ms)
[----------] 1 test from Durability (4 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (4 ms total)
[  PASSED   ] 1 test.
```

Reviewers: ipaljak, vkasljevic

Reviewed By: ipaljak

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1714
2018-10-31 15:29:06 +01:00
Matej Ferencevic
0493470f98 Add support for std::pair in SLK
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1717
2018-10-31 15:21:36 +01:00
Matej Ferencevic
878b5c9f2b Improve analyze_rpc_calls script
Reviewers: mtomic

Reviewed By: mtomic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1715
2018-10-31 14:30:07 +01:00
Matej Ferencevic
60fb4901f5 Initial version of custom serialization
Reviewers: teon.banek, buda

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1711
2018-10-31 12:00:43 +01:00