Commit Graph

1097 Commits

Author SHA1 Message Date
matej.gradicek
c820b25c9c Changed tmpnam with mkdtemp
Reviewers: dgleich, buda

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D431
2017-06-16 07:49:10 +00:00
Teon Banek
527d69d382 Fix errors with handling SIGSEGV and SIGABRT
Summary:
There were a couple of issues with handling the above 2 signals.

1) Calling `std::exit` from a signal handler is undefined behaviour.

The only defined way for a signal handler to stop the program is calling
one of: `std::_Exit`, `std::abort` or `std::quick_exit`. Neither of them
will completely clean the resources, so a clean exit is not possible.
Since SIGSEGV and SIGABRT happen in extraordinary circumstances that we
wish to debug 99% of the time, it makes sense to generate a core dump
which can be inspected by a debugger. Of the 3 termination functions,
only `std::abort` will generate a core dump, so it makes sense to use
that to stop the program.

Also, since we are now aborting as is the default behaviour on SIGSEGV
and SIGABRT, it becomes questionable why have a custom handler at all.

2) Raising an exception inside a signal handler is undefined behaviour

Although the handler by itself does not raise an exception, it is
possible for the logging facility to raise one. This is a real case when
logging a stack trace in particular. Stack trace is generated by
creating a string "<function name> <line location>". It is possible that
a function name will contain '{}' somewhere inside. This is usually the
case with anonymous functions. The generated string is then passed to
logging, which uses the `fmt` library to fill '{}' with remaining
arguments. Since only a single argument (the stack trace string) is
passed for formatting, naturally the `fmt::format` throws an exception,
that it is missing a format argument.

We could provide an overload which takes a single string, but that
defeats the purpose of `fmt::format` raising an exception in regular
code if we forget to pass an argument. Another solution is to escape the
whole stack trace string, so it is valid for formatting, but this only
complicates the handler even further. The simplest solution is to send
the stack trace to `stderr` and avoid logging altogether.

Simplify Shutdown, so it can be used in a signal handler

Reviewers: florijan, mferencevic, buda, mislav.bradac

Reviewed By: mferencevic, buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D474
2017-06-16 08:53:07 +02:00
Teon Banek
13ae13bf43 Make asserts abort the program instead of exiting cleanly
Summary:
Since assertions should signify an abnormal program condition, it makes
sense for them to call `std::abort`. This way, we'll get a core dump
which can be inspected in a debugger.

Update utils/assert.hpp documentation

Reviewers: florijan, buda, mislav.bradac

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D475
2017-06-16 08:52:36 +02:00
Mislav Bradac
67b859cf13 Add AST cache
Reviewers: buda, teon.banek, florijan

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D468
2017-06-14 18:59:31 +02:00
florijan
b6da65b9e7 Skiplist - GC - race condition fix
Summary: An unpleasant race-condition detected. Solution proposed. It's not very pretty. Perhaps consider using the ConcurrentPushQueue. Not 100% sure, but it should make the GC code easier to work with.

Reviewers: buda, mislav.bradac, teon.banek, dgleich

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D469
2017-06-14 16:16:53 +02:00
Matej Ferencevic
928f52af47 Added alpha documentation bundle script.
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D470
2017-06-14 15:54:15 +02:00
Marko Budiselic
c081281944 Docker mount volume documentation.
Summary: Add snapshots mount documentation. By default, build_interpreter takes alpha.conf as a config file.

Reviewers: teon.banek, dtomicevic

Reviewed By: teon.banek

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D464
2017-06-14 10:15:05 +02:00
Teon Banek
7de8fd4b1b Reorganize logging in memgraph_bolt.cpp
Summary:
Remove utils/stacktrace/log.hpp
The single function defined in log.hpp is used only in
memgraph_bolt.cpp. Therefore, the function has been moved and the file
removed.

Move utils/stacktrace/stacktrace.hpp one level up

Move some logging from memgraph_bolt to Server

Reviewers: buda, dtomicevic

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D465
2017-06-14 10:11:31 +02:00
Mislav Bradac
c56eb4310e Remember token positions for literals
Summary: Remove yaml

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D466
2017-06-13 17:11:27 +02:00
Mislav Bradac
c8e25987b8 Add asserts to placeholder
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D463
2017-06-13 14:54:17 +02:00
Teon Banek
69cfd197d8 Don't raise TypedValueException during query execution
Summary:
Handle TypedValueExceptions in query/plan/operator.cpp

Raise QueryRuntimeException during expression evaluation

Reviewers: florijan, mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D457
2017-06-13 14:46:56 +02:00
Marko Budiselic
c737c73d05 Antlr download.
Summary: Bug fix. Don't create a backup file on new wget download.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D462
2017-06-13 12:48:10 +02:00
florijan
9e6260d0c3 tx::Engine - commit log encapsulation
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D460
2017-06-13 12:32:48 +02:00
Mislav Bradac
f7d540829a Add deep clone to Ast
Summary: Prepare your aspergillums for blessing this magnificent diff.

Reviewers: buda, teon.banek, florijan

Reviewed By: teon.banek

Subscribers: lion, pullbot

Differential Revision: https://phabricator.memgraph.io/D458
2017-06-13 12:22:25 +02:00
Teon Banek
c6b2336f04 Silence ctest when running for coverage
Summary:
There's no need to see the results of tests, since we are only running
ctest to generate code coverage reports.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D461
2017-06-13 11:54:43 +02:00
Marko Budiselic
418bbea69d Update of package_deploy script.
Summary: Add --skip-deploy parameter to release/package_deploy script. Packaged file renaming.

Reviewers: teon.banek, mferencevic

Reviewed By: teon.banek

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D459
2017-06-13 11:00:18 +02:00
Marko Budiselic
4b358ec02e Quick start docs.
Summary: Quick start section. Still work in progress.

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D450
2017-06-13 10:17:16 +02:00
florijan
c12990ae33 DynamicBitset - const correctness, tests, docs
Reviewers: dtomicevic, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D453
2017-06-13 09:18:20 +02:00
Marko Budiselic
47b8a48df2 Python driver test.
Summary: Python driver test. Equivalent to all other driver tests.

Reviewers: mferencevic, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D452
2017-06-12 15:53:43 +02:00
Teon Banek
3b88d7429f Visit edge properties during symbol generation
Summary:
This is an obvious bug, caused by an oversight. A test has been added
for this case.

Reviewers: florijan, mislav.bradac, buda

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D455
2017-06-12 15:27:15 +02:00
Mislav Bradac
d46945f259 Make GraphDbTypes const
Reviewers: florijan

Reviewed By: florijan

Differential Revision: https://phabricator.memgraph.io/D456
2017-06-12 15:24:30 +02:00
Marko Budiselic
28173eaa3e Bipartite stress test.
Summary: Bipartite stress test. Common methods useful in the process of testing with python Bolt driver.

Reviewers: mislav.bradac, florijan

Reviewed By: florijan

Subscribers: florijan, pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D423
2017-06-12 10:47:37 +02:00
florijan
afbb940a05 GC bugfixes, MVCC and transaction refactoring
Summary:
- GC changed to evaluate old records w.r.t. the oldest transaction's id AND snapshot, as opposed to only id
- MVCC hints exp+aborted race condition prevented
- minor MVCC refactors and cleanups
- minor Transaction refactors and cleanups

Reviewers: buda, dgleich

Reviewed By: buda, dgleich

Subscribers: dtomicevic, pullbot

Differential Revision: https://phabricator.memgraph.io/D434
2017-06-12 10:46:12 +02:00
Teon Banek
025e557204 Validate the --num_workers flag
Reviewers: dgleich, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D449
2017-06-09 16:16:38 +02:00
Marko Budiselic
c20557f3c7 Installation docs.
Summary: Basic How to installation document.

Reviewers: teon.banek, florijan

Reviewed By: teon.banek

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D445
2017-06-09 15:54:05 +02:00
Teon Banek
0f0c5cb8b7 Add some upcoming Cypher features to the docs
Reviewers: florijan, mislav.bradac, buda, dtomicevic

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D444
2017-06-09 15:23:44 +02:00
Dominik Gleich
972c62e102 Fix signals. Add recovery status.
Reviewers: teon.banek, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D451
2017-06-09 13:25:24 +02:00
Dominik Gleich
9f4e6243d8 Fix.
Reviewers: teon.banek

Reviewed By: teon.banek

Differential Revision: https://phabricator.memgraph.io/D448
2017-06-09 11:40:06 +02:00
Dominik Gleich
0fb29a7ce0 Add release logging without core dump.
Reviewers: buda, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D447
2017-06-09 11:26:19 +02:00
Dominik Gleich
1057d253ca Rename config flags.
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D446
2017-06-09 10:52:26 +02:00
Matej Ferencevic
6308ec6a34 Added javascript and java driver tests.
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D438
2017-06-09 10:12:25 +02:00
Teon Banek
532f38ca3f Add a short chapter on Bolt Protocol
Summary:
Do some minor corrections to openCypher docs

Add links to Bolt drivers in our documentation

Reviewers: florijan, buda, mferencevic, dtomicevic

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D440
2017-06-08 16:31:08 +02:00
Teon Banek
2a7a117720 Remove some unused stuff from CMakeLists
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D443
2017-06-08 16:30:21 +02:00
Teon Banek
04a5bdeb82 Remove unused config source code files
Reviewers: dgleich, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D442
2017-06-08 16:10:55 +02:00
Marko Budiselic
f84f9af244 Alpha package scripts.
Summary: Alpha package scripts. Alpha version is going to be shipped within docker.

Reviewers: teon.banek, mferencevic

Reviewed By: teon.banek

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D436
2017-06-08 14:15:55 +02:00
Teon Banek
7091be1891 Don't pass MEMGRAPH_ALL_LIBS to all cmake targets
Summary:
CMake is smart enough to transitively detect dependencies and link them
appropriately. Therefore, it is enough that we put all libraries that
memgraph uses to the dependency list of memgraph_lib and memgraph_pic
targets.

Patch the fmt library for C++14 and higher

fmt library would detect that C++11 is supported and then put the
compiler flag. This flag was set so it overrides parent project compiler
flags. This override from fmt would prevent us from using C++14
features. New version (3.1) of fmt resolves this issue, but it hasn't
been released yet. Therefore, this commit updates the script which
clones fmt to use the released 3.0.1 version and apply the fix on that.

Reviewers: dgleich, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D441
2017-06-08 14:14:01 +02:00
Teon Banek
9c6c0c655b Add technical documentation on openCypher
Summary:
This is a basic overview of various supported features of openCypher in
Memgraph. A lot of the documentation refers to Neo4j manual. This needs to
change in the future.

Reviewers: buda, dtomicevic, mislav.bradac, florijan

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D439
2017-06-08 09:42:43 +02:00
Teon Banek
f069677b39 Add print-operator-tree command to gdb
Summary:
This is a simple extension to gdb, which will print the LogicalOperator
tree. Auto loading of the extension is supported via .gdbinit if the gdb
is run from the root of the repository.

Explicit loading of scripts can be done inside gdb by running
`source path/to/extension.py`.

Reviewers: florijan, mislav.bradac, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D428
2017-06-08 09:37:05 +02:00
Marko Budiselic
837e537a32 Setup and run Neo4j Web Browser + Web socket proxy.
Summary:
Experimental script to setup and run Neo4j Web Browser + Web socket proxy.

Note! This script isn't perfect. The only purpose of this script is to setup
WS proxy with Memgraph (Memgraph has to be started manually on the default Bolt
port - 7687) + Neo4j Web Browser. The plan is to hack Neo4j Browser to work with
Memgraph but that isn't easy because of CALL queries & absence of global
vertex identifiers.

Reviewers: dtomicevic, mferencevic, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D430
2017-06-08 09:23:10 +02:00
Mislav Bradac
fea9031605 Refactor stripper
Summary: Fix tests

Reviewers: buda, florijan, teon.banek

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D435
2017-06-07 18:47:09 +02:00
Matej Ferencevic
e9ca6d8243 Fixed SIGTERM handler.
Summary: Merge branch 'dev' into fix_signals

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D432
2017-06-07 15:56:34 +02:00
Mislav Bradac
a45e5a9a38 Remove old snapshot
Reviewers: buda, matej.gradicek

Reviewed By: buda

Differential Revision: https://phabricator.memgraph.io/D437
2017-06-07 15:47:24 +02:00
Dominik Gleich
65507da9eb Load configs from flagfiles.
Summary: Migrate configto gflags.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D433
2017-06-07 15:38:17 +02:00
Matej Gradiček
d8e06d12c1 M2S4 tck tests
Reviewers: buda, mislav.bradac, teon.banek

Reviewed By: buda, teon.banek

Differential Revision: https://phabricator.memgraph.io/D419
2017-06-07 10:37:39 +00:00
Teon Banek
46581bfc94 Setup a basic skeleton for Technical Documentation
Reviewers: buda, dtomicevic

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D427
2017-06-07 11:08:45 +02:00
Dominik Gleich
ebdee4e509 Skiplist garbage collector rework.
Summary:
Drawing:
https://drive.google.com/open?id=0B-W7PQZqMD9hcG04b0lKaGZGOWM

Reviewers: mislav.bradac, buda, florijan

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D395
2017-06-07 10:47:02 +02:00
Dominik Gleich
141d9b3bb8 Rework of index api. Remove implicit default value of current_state in graph_db_accessor.
Reviewers: buda, florijan

Reviewed By: buda, florijan

Subscribers: mislav.bradac, pullbot

Differential Revision: https://phabricator.memgraph.io/D392
2017-06-07 10:14:55 +02:00
Mislav Bradac
9acdc632e9 Add google flag for number of workers
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D429
2017-06-06 18:52:03 +02:00
matej.gradicek
15b57e2d52 Implemented recovery and tests.
Summary: Implemented durability recovery and tesats.

Reviewers: mislav.bradac, dgleich, buda

Reviewed By: mislav.bradac, dgleich, buda

Subscribers: dtomicevic, mferencevic, pullbot

Differential Revision: https://phabricator.memgraph.io/D374
2017-06-06 15:12:34 +00:00
Teon Banek
7278bdff94 Check for aggregation in all Expression types
Summary:
This fixes an issue when aggregations and/or group by expressions
weren't picked up from certain operators. In addition to that, we would
segfault in cases when the `has_aggregation_` is empty. For example,
function calls without arguments: `RETURN PI()`.

Test aggregations inside some operators

Reviewers: florijan, mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D425
2017-06-06 15:05:43 +02:00