1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into devel

This commit is contained in:
Jan Steemann 2016-08-05 16:18:24 +02:00
commit cb4b091301
23 changed files with 602 additions and 319 deletions

View File

@ -131,14 +131,15 @@ FOR vertex[, edge[, path]]
are multiple paths from *startVertex* to *vertex*, one of those is picked.
- "none" (default) no uniqueness check is applied on vertices
- **uniqueEdges** (string): optionally ensure edge uniqueness
- "path" it is guaranteed that there is no path returned with a duplicate edge
- "path" (default) it is guaranteed that there is no path returned with a
duplicate edge
- "global" it is guaranteed that each edge is visited at most once during
the traversal, no matter how many paths lead from the start vertex to this edge.
If you start with a `min depth > 1`, an edge that was found before *min* depth
might not be returned at all (it still might be part of a path). **Note:**
Using this configuration the result is not deterministic any more. If there
are multiple paths from *startVertex* over *edge* one of those is picked.
- "none" (default) no uniqueness check is applied on edges. **Note:**
- "none" no uniqueness check is applied on edges. **Note:**
Using this configuration the traversal will follow cycles in edges.
- **bfs** (bool): optionally use the alternative breadth-first traversal algorithm
- true the traversal will be executed breadth-first. The results will first

View File

@ -47,5 +47,6 @@ The following methods exist on the collection object (returned by *db.name*):
* [collection.rename()](../../DataModeling/Collections/CollectionMethods.md#rename)
* [collection.replace(selector, data)](../../DataModeling/Documents/DocumentMethods.md#replace)
* [collection.replaceByExample(example, data)](../../DataModeling/Documents/DocumentMethods.md#replace-by-example)
* [collection.save(data)](../../DataModeling/Documents/DocumentMethods.md#insert)
* [collection.update(selector, data)](../../DataModeling/Documents/DocumentMethods.md#update)
* [collection.updateByExample(example, data)](../../DataModeling/Documents/DocumentMethods.md#update-by-example)

View File

@ -211,7 +211,6 @@ It is used to demonstrate raw traversal operations.
The above referenced chapters describe the various APIs of ArangoDBs graph engine with small examples. Our cookbook has some more real life examples:
- [Traversing a graph in full depth](https://docs.arangodb.com/cookbook/Graph/FulldepthTraversal.html)
- [Search for vertices of special type connecting a given subgraph](https://docs.arangodb.com/cookbook/Graph/FindingConnectedVerticesForSubgraphs.html)
- [Using an example vertex with the java driver](https://docs.arangodb.com/cookbook/Graph/JavaDriverGraphExampleVertex.html)
- [Retrieving documents from ArangoDB without knowing the structure](https://docs.arangodb.com/cookbook/Graph/JavaDriverBaseDocument.html)
- [Using a custom visitor from node.js](https://docs.arangodb.com/cookbook/Graph/CustomVisitorFromNodeJs.html)

View File

@ -61,7 +61,7 @@ is here:
* [part 2](https://www.arangodb.com/2014/12/02/building-hypermedia-apis-design)
* [part 3](https://www.arangodb.com/2014/12/08/building-hypermedia-apis-foxxgenerator)
A cookbook recipe for getting started with FoxxGenerator is [here](https://docs.arangodb.com/cookbook/Foxx/GeneratorFirstSteps.html).
A cookbook recipe for getting started with FoxxGenerator is [here](https://docs.arangodb.com/2.8/cookbook/FoxxGeneratorFirstSteps.html).
!SECTION AQL improvements

View File

@ -207,7 +207,7 @@ You can now write tests for your Foxx apps using the Mocha testing framework:
https://www.arangodb.com/2015/04/testing-foxx-mocha/
A recipe for writing tests for your Foxx apps can be found in the cookbook:
https://docs.arangodb.com/cookbook/Foxx/Testing.html
https://docs.arangodb.com/2.8/cookbook/FoxxTesting.html
!SUBSECTION API Documentation

View File

@ -61,7 +61,7 @@ The properties `setup` and `teardown` have been moved into the `scripts` propert
!SUBSECTION Foxx Queues
Function-based Foxx Queue job types are no longer supported. To learn about how you can use the new script-based job types [follow the updated recipe in the cookbook](https://docs.arangodb.com/cookbook/Foxx/Queues.html).
Function-based Foxx Queue job types are no longer supported. To learn about how you can use the new script-based job types [follow the updated recipe in the cookbook](https://docs.arangodb.com/2.8/cookbook/FoxxQueues.html).
!SUBSECTION Foxx Sessions

View File

@ -39,19 +39,16 @@
Name: @CPACK_PACKAGE_NAME@
Version: @CPACK_PACKAGE_VERSION@
Release: 1.1
Release: @ARANGODB_PACKAGE_REVISION@
Summary: The open-source, multi-model NoSQL database
License: Apache-2.0
Group: Productivity/Databases/Servers
Conflicts: arangodb3-client
Url: http://www.arangodb.com
Source: arangodb-%{version}.tar.bz2
Source1: init-files.tar.bz2
Vendor: @CPACK_PACKAGE_VENDOR@
Prefix: @CPACK_PACKAGING_INSTALL_PREFIX@
BuildRoot: @CMAKE_CURRENT_BINARY_DIR@/_CPack_Packages/Linux/RPM/@CPACK_PACKAGE_FILE_NAME@
BuildRequires: cmake make, python
%{?systemd_requires}
%define debug_package %{nil}
@ -60,139 +57,6 @@ BuildRequires: cmake make, python
## --SECTION-- build dependencies
## -----------------------------------------------------------------------------
################################################################################
### @brief SUSE
################################################################################
%if 0%{?suse_version}
%if 0%{?sles_version} == 11
BuildRequires: python-argparse
%endif
BuildRequires: cmake
BuildRequires: libopenssl-devel
BuildRequires: pwdutils
BuildRequires: fdupes
BuildRequires: libicu-devel
%if 0%{?suse_version} == 1310 || 0%{?suse_version} == 1320
BuildRequires: libstdc++6
%endif
%if 0%{?suse_version} >= 1210
BuildRequires: systemd
%endif
%if 0%{?suse_version} == 1315 || 0%{?suse_version} == 1330
BuildRequires: gcc5-c++
%define C_COMPILER gcc-5
%define CXX_COMPILER g++-5
%else
BuildRequires: arangodb-gcc54
%define C_COMPILER /opt/arangodb/bin/gcc
%define CXX_COMPILER /opt/arangodb/bin/g++
%endif
%if 0%{?sles_version} == 11
BuildRequires: libicu-devel
%define JEMALLOC_OPT %{nil}
%else
%if 0%{?suse_version} == 1315
BuildRequires: arangodb-jemalloc-devel-static
%else
BuildRequires: jemalloc-devel-static
%endif
%define JEMALLOC_OPT -DFORCE_JEMALLOC_LIB=:libjemalloc.a
%endif
%endif
################################################################################
### @brief red-hat or centos
################################################################################
%if 0%{?centos_version} || 0%{?rhel_version}
%if 0%{?centos_version} == 600
BuildRequires: python-argparse
%endif
%if 0%{?rhel_version} == 600
BuildRequires: cmake = 3.5.2
BuildRequires: python-argparse
%else
BuildRequires: cmake
%endif
%define _skipFdupes 1
BuildRequires: glibc-devel
BuildRequires: arangodb-gcc54
BuildRequires: arangodb-jemalloc-devel-static
BuildRequires: openssl-devel
BuildRequires: redhat-rpm-config
%define JEMALLOC_OPT -DFORCE_JEMALLOC_LIB=:libjemalloc.a
%define C_COMPILER /opt/arangodb/bin/gcc
%define CXX_COMPILER /opt/arangodb/bin/g++
%ifarch i686 i586 i486 i386
%define optflags -O2 -g -march=i586
%endif
%endif
################################################################################
### @brief fedora
################################################################################
%if 0%{?fedora_version}
%define _skipFdupes 1
BuildRequires: cmake
BuildRequires: glibc-devel
BuildRequires: openssl-devel
BuildRequires: libicu-devel
%if 0%{fedora_version} == 22 || 0%{fedora_version} == 23
BuildRequires: libstdc++-static
BuildRequires: gcc-c++
BuildRequires: jemalloc-devel
%define JEMALLOC_OPT %{nil}
%define C_COMPILER gcc
%define CXX_COMPILER g++
%else
BuildRequires: arangodb-gcc54
BuildRequires: arangodb-jemalloc-devel-static
%define JEMALLOC_OPT -DFORCE_JEMALLOC_LIB=:libjemalloc.a
%define C_COMPILER /opt/arangodb/bin/gcc
%define CXX_COMPILER /opt/arangodb/bin/g++
%endif
%endif
################################################################################
### @brief mdk
################################################################################
%if 0%{?mdkversion}
BuildRequires: openssl-devel
BuildRequires: libicu-devel
%define _skipFdupes 1
%endif
## -----------------------------------------------------------------------------
## --SECTION-- client only package
## -----------------------------------------------------------------------------
%package client
Summary: ArangoDB shell as stand-alone package
Group: Productivity/Databases/Servers
@ -216,92 +80,20 @@ The ArangoDB shell as stand-alone program. It also contains the utility programs
## -----------------------------------------------------------------------------
## --SECTION-- build
## -----------------------------------------------------------------------------
%prep
%setup -q -n arangodb-%{version}
%setup -q -n arangodb-%{version} -T -D -a 1
%build
export CC="%{C_COMPILER}"
export CXX="%{CXX_COMPILER}"
export CFLAGS="-g -static-libgcc -O3 -fno-omit-frame-pointer"
export CXXFLAGS="-g -static-libgcc -static-libstdc++ -O3 -fno-omit-frame-pointer"
export V8_CFLAGS="-static-libgcc"
export V8_CXXFLAGS="-static-libgcc -static-libstdc++"
export V8_LDFLAGS="-static-libgcc -static-libstdc++"
export PATH="/opt/arangodb/bin:$PATH"
mkdir build
cd build
cmake \
-DVERBOSE=On \
-DUSE_OPTIMIZE_FOR_ARCHITECTURE=Off \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_FLAGS="${CFLAGS}" \
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
-DCMAKE_C_COMPILER="%{C_COMPILER}" \
-DCMAKE_CXX_COMPILER="%{CXX_COMPILER}" \
%{JEMALLOC_OPT} \
-DETCDIR=/etc \
-DVARDIR=/var \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DCMAKE_INSTALL_DATADIR:PATH=/usr/share \
-DCMAKE_SKIP_RPATH:BOOL=ON \
-DCMAKE_USER_MAKE_RULES_OVERRIDE= \
..
make %{?_smp_mflags} VERBOSE=1 V=1 Verbose=1 all
# requires source:
#%prep
#%setup -q -n arangodb-%{version}
#%setup -q -n arangodb-%{version} -T -D -a 1
## -----------------------------------------------------------------------------
## --SECTION-- install
## -----------------------------------------------------------------------------
%install
export CC="%{C_COMPILER}"
export CXX="%{CXX_COMPILER}"
export CFLAGS="-g -static-libgcc -O3 -fno-omit-frame-pointer"
export CXXFLAGS="-g -static-libgcc -static-libstdc++ -O3 -fno-omit-frame-pointer"
export V8_CFLAGS="-static-libgcc"
export V8_CXXFLAGS="-static-libgcc -static-libstdc++"
export V8_LDFLAGS="-static-libgcc -static-libstdc++"
export PATH="/opt/arangodb/bin:$PATH"
find js -xtype l -exec rm "{}" ";"
cd build
make DESTDIR=%{buildroot} install
mkdir -p %{buildroot}%{_databasedir}
mkdir -p %{buildroot}%{_appdir}
mkdir -p %{buildroot}%{_logdir}
mkdir -p %{buildroot}%{_piddir}
# use %doc to install readme
rm -f %{buildroot}/usr/share/doc/packages/arangodb3/*
rm -f %{buildroot}/usr/share/doc/arangodb3/*
%if 0%{?suse_version}
%if 0%{?suse_version} >= 1230
%{__install} -D -m 0755 ../rc.arangod.OpenSuSE_13 %{buildroot}%{_sysconfdir}/init.d/arangodb3
%else
%{__install} -D -m 0755 ../rc.arangod.OpenSuSE %{buildroot}%{_sysconfdir}/init.d/arangodb3
%endif
ln -s %{_sysconfdir}/init.d/arangodb3 %{buildroot}%{_sbindir}/rcarangodb
%if 0%{?suse_version} >= 1210
%{__install} -D -m 0644 ../arangodb.service %{buildroot}%{_unitdir}/arangodb3.service
%endif
%else
%{__install} -D -m 0755 ../rc.arangod.Centos %{buildroot}%{_sysconfdir}/init.d/arangodb3
%endif
%if %{_skipFdupes} == 0
%fdupes %{buildroot}%{_datadir}/arangodb3
%endif
## -----------------------------------------------------------------------------
## --SECTION-- check
@ -315,10 +107,17 @@ ln -s %{_sysconfdir}/init.d/arangodb3 %{buildroot}%{_sbindir}/rcarangodb
%files
%defattr(-,root,root,0755)
%doc README
%doc README.md
%doc LICENSE
%doc LICENSES-OTHER-COMPONENTS.md
#@CPACK_PACKAGING_INSTALL_PREFIX@/@LIB_INSTALL_DIR@/*
#@CPACK_PACKAGING_INSTALL_PREFIX@/bin/*
#%doc README
#%doc README.md
#%doc LICENSE
#%doc LICENSES-OTHER-COMPONENTS.md
/usr/share/doc/arangodb3/LICENSE.txt
/usr/share/doc/arangodb3/LICENSES-OTHER-COMPONENTS.md
/usr/share/doc/arangodb3/README.md
/usr/share/doc/arangodb3/README.txt
%attr(0755,arangodb,arangodb) %{_databasedir}
%attr(0755,arangodb,arangodb) %{_appdir}
%attr(0755,arangodb,arangodb) %{_logdir}
@ -339,10 +138,10 @@ ln -s %{_sysconfdir}/init.d/arangodb3 %{buildroot}%{_sbindir}/rcarangodb
%files client
%defattr(-,root,root,0755)
%doc README
%doc README.md
%doc LICENSE
%doc LICENSES-OTHER-COMPONENTS.md
#%doc README
#%doc README.md
#%doc LICENSE
#%doc LICENSES-OTHER-COMPONENTS.md
%config(noreplace) %attr(-,arangodb,arangodb) %{_cfgdir}/arangosh.conf
%config(noreplace) %attr(-,arangodb,arangodb) %{_cfgdir}/arangoimp.conf

View File

@ -0,0 +1,99 @@
#!/bin/bash
#
# arangod Startup script for the ArangoDB Server
#
# chkconfig: - 85 15
# description: ArangoDB Server
# processname: arangod
# config: /etc/arangodb3/arangod.conf
# Source function library.
. /etc/rc.d/init.d/functions
# Path to the server binary
ARANGO_BIN=/usr/sbin/arangod
test -x $ARANGO_BIN || exit 5
ARANGO_SYSCONFIG=/etc/arangodb3/arangod.conf
test -r $ARANGO_SYSCONFIG || exit 6
pidfile=/var/run/arangodb/arangod.pid
RETVAL=0
start() {
echo -n $"Starting $ARANGO_BIN: "
PIDDIR=`dirname $pidfile`
[ -d $PIDDIR ] || mkdir $PIDDIR || exit 1
( cd /var/log/arangodb3 && chown -R arangodb:arangodb . && chmod 700 .) || exit 1
( cd /var/lib/arangodb3 && chown -R arangodb:arangodb . && chmod 700 .) || exit 1
( cd /var/lib/arangodb3-apps && chown -R arangodb:arangodb . && chmod 700 .) || exit 1
( cd $PIDDIR && chown arangodb:arangodb . && chmod 700 .) || exit 1
ulimit -H -n 131072 || true
ulimit -S -n 131072 || true
if [ "$1" = "--upgrade" ]; then
$ARANGO_BIN --uid arangodb --gid arangodb $@
RETVAL=$?
else
$ARANGO_BIN --uid arangodb --gid arangodb --log.foreground-tty false --database.check-version
RETVAL=$?
if test $RETVAL -eq 0; then
$ARANGO_BIN --uid arangodb --gid arangodb --log.foreground-tty false --pid-file "$pidfile" --temp.path "/var/tmp/arangod" --supervisor $@
RETVAL=$?
else
echo "database version check failed, maybe need to run 'upgrade'?"
fi
fi
echo
return $RETVAL
}
stop() {
echo -n $"Stopping $ARANGO_BIN: "
killproc -p "${pidfile}" -d 10 $ARANGO_BIN
RETVAL=$?
echo
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p ${pidfile} $ARANGO_BIN
RETVAL=$?
;;
restart)
stop
start
;;
upgrade)
echo $"Upgrading ArangoDB database files"
start --upgrade
;;
*)
echo $"Usage: $0 {start|stop|restart|status|help|upgrade}"
exit 1
esac
exit $RETVAL

View File

@ -0,0 +1,183 @@
#!/bin/sh
# Copyright (c) 2011-2012 triAGENS GmbH Cologne, Germany.
#
# Author: Achim Brandt <a.brandt@triagens.de>
#
# /etc/init.d/arangodb3
#
# and symbolic its link
#
# /usr/sbin/rcarangodb3
#
### BEGIN INIT INFO
# Provides: arangodb
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Start the ArangoDB daemon
# Description: Start the Arango Database Server daemon.
### END INIT INFO
ARANGO_BIN=/usr/sbin/arangod
test -x $ARANGO_BIN || exit 5
ARANGO_SYSCONFIG=/etc/arangodb3/arangod.conf
test -r $ARANGO_SYSCONFIG || exit 6
ARANGO_TIMEOUT=120
ARANGO_PIDFILE=/var/run/arangodb/arangod.pid
. /etc/rc.status
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
# First reset status of this service
rc_reset
start () {
PIDDIR=`dirname $ARANGO_PIDFILE`
[ -d $PIDDIR ] || mkdir $PIDDIR || exit 1
( cd /var/log/arangodb3 && chown -R arangodb:arangodb . && chmod 700 . ) || exit 1
( cd /var/lib/arangodb3 && chown -R arangodb:arangodb . && chmod 700 . ) || exit 1
( cd /var/lib/arangodb3-apps && chown -R arangodb:arangodb . && chmod 700 . ) || exit 1
( cd $PIDDIR && chown arangodb:arangodb . && chmod 700 . ) || exit 1
ulimit -H -n 131072 || true
ulimit -S -n 131072 || true
if [ "$1" = "--upgrade" ]; then
$ARANGO_BIN --uid arangodb --gid arangodb $@
rc_status -v
else
$ARANGO_BIN --uid arangodb --gid arangodb --log.foreground-tty false --database.check-version
RETVAL=$?
if test $RETVAL -eq 0; then
startproc $ARANGO_BIN --uid arangodb --gid arangodb --log.foreground-tty false --pid-file "$ARANGO_PIDFILE" --temp.path "/var/tmp/arangod" --supervisor $@
rc_status -v
else
echo "database version check failed, maybe need to run 'upgrade'?"
rc_status -v
fi
fi
}
case "$1" in
################################################################################
## Start daemon with startproc(8). If this fails
## the echo return value is set appropriate.
################################################################################
start)
echo -n "Starting ArangoDB daemon"
start
;;
################################################################################
## Stop daemon with killproc(8) and if this fails
## set echo the echo return value.
################################################################################
stop)
echo -n "Shutting down ArangoDB daemon"
killproc -t $ARANGO_TIMEOUT -p $ARANGO_PIDFILE -TERM $ARANGO_BIN
# Remember status and be verbose
rc_status -v
;;
################################################################################
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
################################################################################
try-restart)
$0 status >/dev/null && $0 restart
# Remember status and be quiet
rc_status
;;
################################################################################
## Stop the service and regardless of whether it was
## running or not, start it again.
################################################################################
restart)
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
################################################################################
## Signal the daemon to reload its config. Most daemons
## do this on signal 1 (SIGHUP).
################################################################################
force-reload|reload)
echo -n "Reload service ArangoDB"
echo "reload is currently not supported"
rc_status -v
;;
################################################################################
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
## Status has a slightly different for the status command:
##
## 0 - service running
## 1 - service dead, but /var/run/ pid file exists
## 2 - service dead, but /var/lock/ lock file exists
## 3 - service not running
################################################################################
status)
echo -n "Checking for service ArangoDB"
checkproc -p $ARANGO_PIDFILE $ARANGO_BIN
rc_status -v
;;
################################################################################
## upgrade database
################################################################################
upgrade)
echo -n "Upgrading ArangoDB database files"
start --upgrade
;;
################################################################################
## print usage message
################################################################################
*)
echo "Usage: $0 {start|stop|restart|force-reload|status|upgrade}"
exit 1
;;
esac
rc_exit

View File

@ -0,0 +1,183 @@
#!/bin/sh
# Copyright (c) 2011-2012 triAGENS GmbH Cologne, Germany.
#
# Author: Achim Brandt <a.brandt@triagens.de>
#
# /etc/init.d/arangodb3
#
# and symbolic its link
#
# /usr/sbin/rcarangodb3
#
### BEGIN INIT INFO
# Provides: arangodb
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Start the ArangoDB daemon
# Description: Start the Arango Database Server daemon.
### END INIT INFO
ARANGO_BIN=/usr/sbin/arangod
test -x $ARANGO_BIN || exit 5
ARANGO_SYSCONFIG=/etc/arangodb3/arangod.conf
test -r $ARANGO_SYSCONFIG || exit 6
ARANGO_TIMEOUT=120
ARANGO_PIDFILE=/run/arangodb/arangod.pid
. /etc/rc.status
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
# First reset status of this service
rc_reset
start () {
PIDDIR=`dirname $ARANGO_PIDFILE`
[ -d $PIDDIR ] || mkdir $PIDDIR || exit 1
( cd /var/log/arangodb3 && chown -R arangodb:arangodb . && chmod 700 . ) || exit 1
( cd /var/lib/arangodb3 && chown -R arangodb:arangodb . && chmod 700 . ) || exit 1
( cd /var/lib/arangodb3-apps && chown -R arangodb:arangodb . && chmod 700 . ) || exit 1
( cd $PIDDIR && chown arangodb:arangodb . && chmod 700 . ) || exit 1
ulimit -H -n 131072 || true
ulimit -S -n 131072 || true
if [ "$1" = "--upgrade" ]; then
$ARANGO_BIN --uid arangodb --gid arangodb $@
rc_status -v
else
$ARANGO_BIN --uid arangodb --gid arangodb --log.foreground-tty false --database.check-version
RETVAL=$?
if test $RETVAL -eq 0; then
startproc $ARANGO_BIN --uid arangodb --gid arangodb --pid-file "$ARANGO_PIDFILE" --temp.path "/var/tmp/arangod" --log.foreground-tty false --supervisor $@
rc_status -v
else
echo "database version check failed, maybe need to run 'upgrade'?"
rc_status -v
fi
fi
}
case "$1" in
################################################################################
## Start daemon with startproc(8). If this fails
## the echo return value is set appropriate.
################################################################################
start)
echo -n "Starting ArangoDB daemon"
start
;;
################################################################################
## Stop daemon with killproc(8) and if this fails
## set echo the echo return value.
################################################################################
stop)
echo -n "Shutting down ArangoDB daemon"
killproc -t $ARANGO_TIMEOUT -p $ARANGO_PIDFILE -TERM $ARANGO_BIN
# Remember status and be verbose
rc_status -v
;;
################################################################################
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
################################################################################
try-restart)
$0 status >/dev/null && $0 restart
# Remember status and be quiet
rc_status
;;
################################################################################
## Stop the service and regardless of whether it was
## running or not, start it again.
################################################################################
restart)
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
################################################################################
## Signal the daemon to reload its config. Most daemons
## do this on signal 1 (SIGHUP).
################################################################################
force-reload|reload)
echo -n "Reload service ArangoDB"
echo "reload is currently not supported"
rc_status -v
;;
################################################################################
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
## Status has a slightly different for the status command:
##
## 0 - service running
## 1 - service dead, but /var/run/ pid file exists
## 2 - service dead, but /var/lock/ lock file exists
## 3 - service not running
################################################################################
status)
echo -n "Checking for service ArangoDB"
checkproc -p $ARANGO_PIDFILE $ARANGO_BIN
rc_status -v
;;
################################################################################
## upgrade database
################################################################################
upgrade)
echo -n "Upgrading ArangoDB database files"
start --upgrade
;;
################################################################################
## print usage message
################################################################################
*)
echo "Usage: $0 {start|stop|restart|force-reload|status|upgrade}"
exit 1
;;
esac
rc_exit

View File

@ -336,7 +336,8 @@ priv_rpc_ret_t Agent::sendAppendEntriesRPC(
"1", 1, _config.endpoints[follower_id],
arangodb::GeneralRequest::RequestType::POST, path.str(),
std::make_shared<std::string>(builder.toJson()), headerFields,
std::make_shared<AgentCallback>(this, follower_id, highest), 1, true);
std::make_shared<AgentCallback>(this, follower_id, highest),
0.5*_config.minPing, true, 0.75*_config.minPing);
_lastSent.at(follower_id) = std::chrono::system_clock::now();
_lastHighest.at(follower_id) = highest;
@ -451,7 +452,7 @@ void Agent::run() {
while (!this->isStopping() && size() > 1) {
if (leading()) { // Only if leading
_appendCV.wait(10000);
_appendCV.wait(1000);
} else {
_appendCV.wait(); // Else wait for our moment in the sun
}

View File

@ -41,6 +41,10 @@ bool AgentCallback::operator()(arangodb::ClusterCommResult* res) {
if (_agent) {
_agent->reportIn(_slaveID, _last);
}
} else {
LOG_TOPIC(DEBUG, Logger::AGENCY)
<< "comm_status(" << res->status << "), last("
<< _last << "), follower(" << _slaveID << ")";
}
return true;
}

View File

@ -378,7 +378,7 @@ void Constituent::callElection() {
operationIDs[i] = arangodb::ClusterComm::instance()->asyncRequest(
"1", 1, config().endpoints[i], GeneralRequest::RequestType::GET,
path.str(), std::make_shared<std::string>(body), headerFields,
nullptr, config().minPing, true);
nullptr, 0.75*config().minPing, true, 0.5*config().minPing);
}
}

View File

@ -191,60 +191,60 @@ size_t State::removeConflicts (query_t const& transactions) {
try {
auto idx = slices[0].get("index").getUInt();
auto pos = idx-_cur;
if (idx-_cur < _log.size()) {
if (pos < _log.size()) {
for (auto const& slice : VPackArrayIterator(slices)) {
LOG(WARN) << slice.toJson();
auto trm = slice.get("term").getUInt();
idx = slice.get("index").getUInt();
pos = idx-_cur;
LOG(WARN) << VPackSlice(_log.at(idx-_cur).entry->data());
if (pos < _log.size()) {
if (trm > VPackSlice(
_log.at(idx-_cur).entry->data()).get("term").getUInt()) {
if (idx == _log.at(pos).index && trm != _log.at(pos).term) {
LOG_TOPIC(DEBUG, Logger::AGENCY)
<< "Removing " << _log.size()-idx+_cur
<< " entries from log starting with " << idx << "="
<< _log.at(idx-_cur).index;
LOG_TOPIC(DEBUG, Logger::AGENCY)
<< "Removing " << _log.size()-pos
<< " entries from log starting with " << idx << "=="
<< _log.at(pos).index << " and " << trm << "=" <<_log.at(pos).term;
// persisted logs
std::stringstream aql;
aql << "FOR l IN log FILTER l._key >= '" << stringify(idx)
<< "' REMOVE l IN log";
// persisted logs
std::stringstream aql;
aql << "FOR l IN log FILTER l._key >= '" << stringify(idx)
<< "' REMOVE l IN log";
arangodb::aql::Query
query(false, _vocbase, aql.str().c_str(), aql.str().size(),
bindVars, nullptr, arangodb::aql::PART_MAIN);
arangodb::aql::Query
query(false, _vocbase, aql.str().c_str(), aql.str().size(),
bindVars, nullptr, arangodb::aql::PART_MAIN);
auto queryResult = query.execute(_queryRegistry);
auto queryResult = query.execute(_queryRegistry);
if (queryResult.code != TRI_ERROR_NO_ERROR) {
THROW_ARANGO_EXCEPTION_MESSAGE(
queryResult.code, queryResult.details);
if (queryResult.code != TRI_ERROR_NO_ERROR) {
THROW_ARANGO_EXCEPTION_MESSAGE(
queryResult.code, queryResult.details);
}
queryResult.result->slice();
// volatile logs
{
MUTEX_LOCKER(mutexLocker, _logLock);
_log.erase(_log.begin()+pos, _log.end());
}
break;
} else {
++ndups;
}
queryResult.result->slice();
// volatile logs
{
MUTEX_LOCKER(mutexLocker, _logLock);
_log.erase(_log.begin()+idx-_cur-1, _log.end());
}
break;
}
++ndups;
}
}
} catch (std::exception const& e) {
LOG_TOPIC(ERR, Logger::AGENCY) << e.what() << " " << __FILE__ << __LINE__;
LOG_TOPIC(DEBUG, Logger::AGENCY) << e.what() << " " << __FILE__ << __LINE__;
}
}

View File

@ -424,7 +424,7 @@ void Supervision::shrinkCluster () {
targetNumDBServers = _snapshot("/Target/NumberOfDBServers").getUInt();
} catch (std::exception const& e) {
LOG_TOPIC(DEBUG, Logger::AGENCY)
<< "Cannot retrieve targeted number of db servers from agency" << e.what();
<< "Targeted number of DB servers not set yet: " << e.what();
return;
}

View File

@ -1651,13 +1651,11 @@ AgencyCommResult AgencyComm::sendWithFailover(
std::string endpoint;
// transform location into an endpoint
int offset;
int offset { 11 };
if (result.location().substr(0, 7) == "http://") {
endpoint = "http+tcp://" + result.location().substr(7);
offset = 11;
} else if (result.location().substr(0, 8) == "https://") {
endpoint = "ssl://" + result.location().substr(8);
offset = 6;
endpoint = "http+ssl://" + result.location().substr(8);
} else {
// invalid endpoint, return an error
break;

View File

@ -104,4 +104,5 @@ install(
#get_cmake_property(_variableNames VARIABLES)
#foreach (_variableName ${_variableNames})
# message(STATUS "${_variableName}=${${_variableName}}")
##--------------------------------------------------------------------------------
#endforeach()
#--------------------------------------------------------------------------------

View File

@ -4,7 +4,7 @@
################################################################################
FILE(READ "${PROJECT_SOURCE_DIR}/Installation/debian/packagedesc.txt" CPACK_DEBIAN_PACKAGE_DESCRIPTION)
set(CPACK_DEBIAN_PACKAGE_SECTION "database")
set(CPACK_DEBIAN_PACKAGE_CONFLICTS "arangodb")
set(CPACK_DEBIAN_PACKAGE_CONFLICTS "arangodb, arangodb3-client")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_COMPRESSION_TYPE "xz")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${ARANGODB_URL_INFO_ABOUT})

View File

@ -1,10 +1,12 @@
if (NOT(MSVC))
if (NOT(MSVC) AND NOT ("${PACKAGING}" STREQUAL "RPM"))
set(CPACK_SET_DESTDIR ON)
endif()
set(CPACK_PACKAGE_VENDOR ${ARANGODB_PACKAGE_VENDOR})
set(CPACK_PACKAGE_CONTACT ${ARANGODB_PACKAGE_CONTACT})
set(CPACK_PACKAGE_VERSION "${ARANGODB_VERSION}")
# TODO just for rpm?
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")

View File

@ -13,13 +13,22 @@ set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${AR
# deploy the Init script:
#install(
# FILES ${PROJECT_SOURCE_DIR}/Installation/debian/arangodb.init
# PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
# DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/init.d
# RENAME arangodb3
# COMPONENT debian-extras
# )
set(RPM_INIT_SCRIPT "${PROJECT_SOURCE_DIR}/Installation/rpm/rc.arangod.Centos")
set(RPM_INIT_SCRIPT_TARGET "${CMAKE_INSTALL_FULL_SYSCONFDIR}/init.d")
set(RPM_INIT_SCRIPT_TARGET_NAME arangodb3)
get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
install(
FILES ${RPM_INIT_SCRIPT}
PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
DESTINATION ${RPM_INIT_SCRIPT_TARGET}
RENAME ${RPM_INIT_SCRIPT_TARGET_NAME}
COMPONENT debian-extras
)
################################################################################
# hook to build the server package
@ -27,20 +36,21 @@ set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${AR
add_custom_target(package-arongodb-server
COMMAND ${CMAKE_COMMAND} .
COMMAND ${CMAKE_CPACK_COMMAND} -G RPM
COMMAND cp "${PROJECT_BINARY_DIR}/_CPack_Packages/${CMAKE_SYSTEM_NAME}/RPM/PRMS/${ARANGODB_PACKAGE_ARCHITECTURE}/*.rpm" "${PROJECT_BINARY_DIR}"
# _CPack_Packages/Linux/RPM/RPMS/x86_64/
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
list(APPEND PACKAGES_LIST package-arongodb-server)
################################################################################
# hook to build the client package
################################################################################
set(CLIENT_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/packages/arangodb-client)
configure_file(cmake/packages/client/rpm.txt ${CLIENT_BUILD_DIR}/CMakeLists.txt @ONLY)
add_custom_target(package-arongodb-client
COMMAND ${CMAKE_COMMAND} .
COMMAND ${CMAKE_CPACK_COMMAND} -G RPM
COMMAND cp *.rpm ${PROJECT_BINARY_DIR}
WORKING_DIRECTORY ${CLIENT_BUILD_DIR})
list(APPEND PACKAGES_LIST package-arongodb-client)
#################################################################################
## hook to build the client package
#################################################################################
#set(CLIENT_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/packages/arangodb-client)
#configure_file(cmake/packages/client/rpm.txt ${CLIENT_BUILD_DIR}/CMakeLists.txt @ONLY)
#add_custom_target(package-arongodb-client
# COMMAND ${CMAKE_COMMAND} .
# COMMAND ${CMAKE_CPACK_COMMAND} -G RPM
# COMMAND cp *.rpm ${PROJECT_BINARY_DIR}
# WORKING_DIRECTORY ${CLIENT_BUILD_DIR})
#
#
#list(APPEND PACKAGES_LIST package-arongodb-client)

View File

@ -883,8 +883,8 @@ function runStressTest (options, command, testname) {
// / @brief executes a command, possible with valgrind
// //////////////////////////////////////////////////////////////////////////////
function executeValgrind (cmd, args, options, valgrindTest) {
if (valgrindTest && options.valgrind) {
function executeArangod (cmd, args, options) {
if (options.valgrind) {
let valgrindOpts = {};
if (options.valgrindArgs) {
@ -1269,7 +1269,7 @@ function shutdownInstance (instanceInfo, options) {
// //////////////////////////////////////////////////////////////////////////////
function startInstanceCluster (instanceInfo, protocol, options,
addArgs, name, rootDir) {
addArgs, rootDir) {
let makeArgs = function (name, args) {
args = args || options.extraArgs;
@ -1279,7 +1279,7 @@ function startInstanceCluster (instanceInfo, protocol, options,
let subArgs = makeArgsArangod(options, fs.join(subDir, 'apps'));
subArgs = Object.assign(subArgs, args);
return [subArgs, name, subDir];
return [subArgs, subDir];
};
options.agencySize = 1;
@ -1342,7 +1342,7 @@ function startInstanceCluster (instanceInfo, protocol, options,
return true;
}
function startArango (protocol, options, addArgs, name, rootDir, isAgency) {
function startArango (protocol, options, addArgs, rootDir, isAgency) {
const dataDir = fs.join(rootDir, 'data');
const appDir = fs.join(rootDir, 'apps');
@ -1389,7 +1389,7 @@ function startArango (protocol, options, addArgs, name, rootDir, isAgency) {
}
instanceInfo.url = endpointToURL(instanceInfo.endpoint);
instanceInfo.pid = executeValgrind(ARANGOD_BIN, toArgv(args), options, name).pid;
instanceInfo.pid = executeArangod(ARANGOD_BIN, toArgv(args), options).pid;
if (platform.substr(0, 3) === 'win') {
const procdumpArgs = [
@ -1411,7 +1411,7 @@ function startArango (protocol, options, addArgs, name, rootDir, isAgency) {
}
function startInstanceAgency (instanceInfo, protocol, options,
addArgs, testname, rootDir) {
addArgs, rootDir) {
const dataDir = fs.join(rootDir, 'data');
const N = options.agencySize;
@ -1446,7 +1446,7 @@ function startInstanceAgency (instanceInfo, protocol, options,
let dir = fs.join(rootDir, 'agency-' + i);
fs.makeDirectoryRecursive(dir);
instanceInfo.arangods.push(startArango(protocol, options, instanceArgs, testname, rootDir, true));
instanceInfo.arangods.push(startArango(protocol, options, instanceArgs, rootDir, true));
}
instanceInfo.endpoint = instanceInfo.arangods[instanceInfo.arangods.length - 1].endpoint;
@ -1457,8 +1457,8 @@ function startInstanceAgency (instanceInfo, protocol, options,
}
function startInstanceSingleServer (instanceInfo, protocol, options,
addArgs, testname, rootDir) {
instanceInfo.arangods.push(startArango(protocol, options, addArgs, testname, rootDir, false));
addArgs, rootDir) {
instanceInfo.arangods.push(startArango(protocol, options, addArgs, rootDir, false));
instanceInfo.endpoint = instanceInfo.arangods[instanceInfo.arangods.length - 1].endpoint;
instanceInfo.url = instanceInfo.arangods[instanceInfo.arangods.length - 1].url;
@ -1482,13 +1482,13 @@ function startInstance (protocol, options, addArgs, testname, tmpDir) {
}
else if (options.cluster) {
startInstanceCluster(instanceInfo, protocol, options,
addArgs, testname, rootDir);
addArgs, rootDir);
} else if (options.agency) {
startInstanceAgency(instanceInfo, protocol, options,
addArgs, testname, rootDir);
addArgs, rootDir);
} else {
startInstanceSingleServer(instanceInfo, protocol, options,
addArgs, testname, rootDir);
addArgs, rootDir);
}
if (!options.cluster) {

View File

@ -46,8 +46,8 @@ fi
SECONDARIES="$5"
MINP=0.5
MAXP=2.5
MINP=1.0
MAXP=2.0
COMP=1000
BASE=4001
NATH=$(( $NRDBSERVERS + $NRCOORDINATORS + $NRAGENTS ))
@ -77,6 +77,7 @@ if [ $NRAGENTS -gt 1 ]; then
--server.statistics false \
--server.threads $NATH \
--log.force-direct true \
--log.level agency=debug \
> cluster/$port.stdout 2>&1 &
done
fi
@ -104,6 +105,7 @@ build/bin/arangod \
--server.statistics false \
--server.threads $NATH \
--log.force-direct true \
--log.level agency=debug \
> cluster/$(( $BASE + $aid )).stdout 2>&1 &
start() {

View File

@ -22,7 +22,7 @@ fi
MINP=0.5
MAXP=2.0
SFRE=2.5
COMP=100
COMP=1000
BASE=5001
rm -rf agency