Commit Graph

3815 Commits

Author SHA1 Message Date
Avi Kivity
ca6e4e7d10 Merge seastar upstream 2015-06-15 11:45:00 +03:00
Avi Kivity
a4c711afd4 future: fix future<>::get0()
Empty tuples don't have a first element.
2015-06-15 11:43:38 +03:00
Avi Kivity
ddaaa315c8 future: add a get0() helper to get the first/only member of the result tuple
Reviewed-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-15 11:29:02 +03:00
Avi Kivity
ba24552efe Merge branch 'master' of github.com:cloudius-systems/urchin into db 2015-06-15 11:00:47 +03:00
Avi Kivity
446731cf88 Merge "column family API"
Column family API, from Amnon.
2015-06-15 10:50:23 +03:00
Tomasz Grabiec
c53ed98731 Merge branch 'shlomi/enable_cluster_via_config' from seatar-dev.git 2015-06-15 09:22:41 +02:00
Asias He
1d0b78d80f gossip: Fix capture by ref on a stack variable 2015-06-15 10:08:17 +03:00
Avi Kivity
053566b3e9 deleter: document 2015-06-15 08:47:44 +03:00
Avi Kivity
1769cb4520 temporary_buffer: document 2015-06-14 23:52:25 +03:00
Avi Kivity
5be417175e Merge "snitch creation"
From Vlad:

"Currently database always created a SimpleSnitch and ignores the corresponding parameter
provided by the user. This series fixes this situation:
   - Changes the snitch creation interface to comply the Java-like interface that
     has already been used in a topology_strategy classes family.
   - Fix all the places where a SimpleSnitch has been created ignoring the user configuration."
2015-06-14 17:59:15 +03:00
Avi Kivity
06031ea273 Merge seastar upstream 2015-06-14 17:47:32 +03:00
Avi Kivity
25420a6fdf core: add support for --cpuset command line option
Syntax: [cpu-]cpu(,[cpu-]cpu=)...
Default: all processors
2015-06-14 16:11:31 +03:00
Avi Kivity
f85a2b48bb resource: support using only a subset of a machine's processors
This is useful for running multiple seastar applications on the same
machine, for testing purposes.
2015-06-14 16:10:21 +03:00
Gleb Natapov
50b18a56cd test: add semaphore test 2015-06-14 16:03:46 +03:00
Gleb Natapov
361db498d1 semaphore: add wait() with timeout support 2015-06-14 16:02:19 +03:00
Gleb Natapov
f19ba7c334 Add timer move constructor 2015-06-14 16:02:18 +03:00
Gleb Natapov
1b2bf57a2b move timer out of reactor.hh to its own header 2015-06-14 16:02:16 +03:00
Vlad Zolotarov
2f14c53f4e gossiping_property_file_snitch: use a logger from i_endpoint_snitch
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-14 15:31:58 +03:00
Vlad Zolotarov
e045d8465c db: use snitch name from the configuration file
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-14 15:31:58 +03:00
Vlad Zolotarov
03ffaea768 locator: introduce i_endpoint_snitch::create_snitch()
- Kill make_snitch().
   - i_endpoint_snitch::create_snitch() uses the utilities from class_registrator.hh.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-14 15:31:49 +03:00
Shlomi Livne
39429e2481 Alignment
Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-06-14 12:19:11 +03:00
Shlomi Livne
edfb4fc671 Add support for read seeds from configuration
Moved setting of configuration variables after the configuration file
has been read.

Updated the code parsing seeds to comply with configuration file format
- seeds: <ip1>,<ip2>,<ip3>

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-06-14 11:48:03 +03:00
Shlomi Livne
2c6ba8971f Different seperator for map elements
Origin's --seed-provider-parameters format is seeds=<ip1>,<ip2>,<ip3> to
align with yaml configuration file format and command line options a
different seperator must be used instead of "," - switched to using ";"

Signed-off-by: Shlomi Livne <shlomi@cloudius-systems.com>
2015-06-14 11:32:57 +03:00
Avi Kivity
0b0ad13418 doc: prevent -- from becoming an emdash 2015-06-14 09:20:38 +03:00
Avi Kivity
5251c2523a thread: point out async() as an easy way to launch a thread 2015-06-14 09:14:30 +03:00
Avi Kivity
980a7dc881 thread: more documentation 2015-06-14 08:56:42 +03:00
Raphael S. Carvalho
bf33cae9e1 sstables: re-change buffer size of output streams
Commit 0993142d8 changed buffer size of output streams to a better
number, but this change was lost when translating the sstable write
code to use the thread facility.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-11 15:31:27 +03:00
Gleb Natapov
c2f975bee9 test querying of multiple singular ranges 2015-06-11 15:18:07 +03:00
Gleb Natapov
fc6f6634fa support query of multiple singular ranges 2015-06-11 15:18:07 +03:00
Gleb Natapov
b7155ad862 pass partitions_ranges separately from from read_command
partitions_ranges will be manipulated upon to be split for different
destination, so provide it separately from read_command to not copy the
later for each destination.
2015-06-11 15:18:07 +03:00
Avi Kivity
ce6cd4b67e Merge "Store keyspace strategy options to database"
From Pekka:

"This series fixes up schema management code to store keyspace strategy
options to database. The map is stored as JSON just like in Origin."
2015-06-11 14:21:53 +03:00
Avi Kivity
09f0a90cac Merge seastar upstream 2015-06-11 14:12:16 +03:00
Vlad Zolotarov
2f238e7d2e dpdk: exclude the KNI module from the required modules
We don't use this module and it's compilation is broken in DPDK 2.0.0
against Linux kernels 4.0.x.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-11 14:11:29 +03:00
Pekka Enberg
5b4c073170 db/legacy_schema_tables: Store keyspace strategy options
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-11 13:02:42 +03:00
Pekka Enberg
673c0c1759 JSON parsing and formatting helper functions
There's various places in Origin where we convert a Map to a JSON string
and vice versa.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-11 13:02:42 +03:00
Pekka Enberg
d088cb8181 Fix keyspace strategy options to preserve key-value ordering
Fix keyspace strategy options to preserve key-value ordering by
switching to std::map. We need this to be able to store the map in
database as JSON because unordered maps can cause the schema merging
code to attempt a keyspace update, which we don't support, even though
the values did not change.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-11 13:02:42 +03:00
Avi Kivity
b5b1fa730b dpdk: compatibility with dpdk 2.1 2015-06-11 11:12:07 +03:00
Pekka Enberg
b7a23ddadd database: Memtable flush batching
Currently, we flush out memtables very aggressively which results into
lots of small sstable writes. The proper fix here is to do accounting on
the memtable size but before that happens, bump up the threshold to
another magic number which gives better batching:

  $ ./build/release/seastar --smp 1 --data-file-directories data --commitlog-directory commitlog/

  $ tools/bin/cassandra-stress write -mode cql3 native prepared -rate threads=32

Before:

  Results:
  op rate                   : 37280
  partition rate            : 37280
  row rate                  : 37280
  latency mean              : 0.8
  latency median            : 0.6
  latency 95th percentile   : 1.1
  latency 99th percentile   : 7.6
  latency 99.9th percentile : 11.9
  latency max               : 50.5
  Total operation time      : 00:00:30
  END

After:

  Results:
  op rate                   : 46721
  partition rate            : 46721
  row rate                  : 46721
  latency mean              : 0.7
  latency median            : 0.5
  latency 95th percentile   : 0.9
  latency 99th percentile   : 1.3
  latency 99.9th percentile : 5.8
  latency max               : 96.3
  Total operation time      : 00:00:39
  END

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-06-11 10:24:35 +03:00
Amnon Heiman
2be20ff295 API: Add the column familiy implementation
This adds the API implementation to the column family API.

After this patch the following API will be supported:
/column_family/name
/column_family
/column_family/name/keyspace
2015-06-11 10:12:38 +03:00
Amnon Heiman
b9e3a03483 Expose the column family info in the database
The API needs the column family information in the database object.
This adds function to the database to expose the column family
information.
2015-06-11 09:50:52 +03:00
Amnon Heiman
bde58c9607 Add the Column Family Swagger definition
This adds the Column familiy swagger definition file, the API is
equivelent to the ColumnFamilyStoreMBean definition.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-11 09:50:52 +03:00
Calle Wilund
65f25e1840 Database/commitlog - Fix broken assert
Previous patch added an assert that is not true in the case a test runs
without an attached commit log, yet still generates enough mutations to cause
a memtable flush.

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-06-10 15:20:36 +03:00
Calle Wilund
8b9a63a3c6 Database/commitlog: guard against replay position reordering
Commit log guarantees that once an RP is assigned to a data frame/caller, it
will not block before returning the result via future. However, this is not
enough, since we could
a.) Have blocked earlier, in which case the return value processing will be
async anyway
b.) Even if no blocking takes place, future chaining mechanism could decide
it has to reorder execution.

Assuming though that the case where this happens is rare, and cases where it
actually affects the rule of replay position ordering is even rarer, we can
guard against it by simply keeping track of the highest RP _discarded_ (sent
to sstable flush), and if we attempt to apply a mutation with a higher RP,
simply re-do the operation (i.e. write same entry to commit log again).

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-06-10 11:56:45 +03:00
Avi Kivity
4c4e90a948 Merge seastar upstream 2015-06-10 11:49:08 +03:00
Avi Kivity
c4756c7622 fstream: fix dropped future in write path
Noticed by Raphael.
2015-06-10 11:48:20 +03:00
Avi Kivity
11b09a0b27 Merge "snitching"
From Vlad:

"The series includes the first production snitch implementation:
gossiping_property_file_snitch.

There are also a few fixes/improvements in different parts of the project
that were discovered on the way."
2015-06-10 10:29:50 +03:00
Vlad Zolotarov
dc732d95d5 gossiping_property_file_snitch_test: Checks parsing facilities of gossiping_property_file_snitch class
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>

New in v2:
   - Added "missing declarations" tests
   - tests/urchin/snitch_property_files: renamed: s/-/_/
   - Reworked to use boost testing facilities
   - Use snitch::stop().
2015-06-09 15:33:38 +03:00
Vlad Zolotarov
cbbdcad649 locator: gossiping_property_file_snitch
Reads the configuration from cassandra-rackdc.properties.
This file may include the following fields:
   - dc: Local Data Center name
   - rack: Local Rack name
   - prefer_local: A boolean value that defines if cluster should prefer
                   local address - relevant for AWS cloud.

Class will schedule a timer that will re-read the property file and inform a
Gossiper if there are changes in the local configuration.

Differences from the Origin C* implementation:
   - No support for a legacy property_file_snitch.
   - Class supports overriding the property file name in a constructor.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>

New in v4:
   - Fix a debug compilation: define reload_property_file_period() to be a constexpr
     method instead of a member.
   - Don't stop() the snitch when snitch_is_ready is set to an exceptional state.

New in v2:
   - Adjust to new file interface.
   - Futurize reload_propery_file().
   - Use trim() and split() from boost::algorithm.
   - Read optimization and logging:
      - Re-read the file only if it was changed since the last read.
      - Use logging facilities from log.hh.
   - Cleanups:
      - Introduce bad_property_file_error exception.
      - Remove unnecessary check after dma_read_exactly() call.
   - Styling.
   - Copyright.
   - Move most of the functions implementation into the .cc file.
   - Added stop() method.
2015-06-09 15:33:38 +03:00
Vlad Zolotarov
aa11ebca41 locator: added a production_snitch_base implementation
- Implements the non-trivial versions of get_rack() and get_datacenter().
     Performs a lookup in a following order:
        1) Searches in a gossiper::endpoint_state_map.
        2) Searches in a SystemTable.
        3) If not found in any of the above returns a default value.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>

New in v2:
   - Introduce db::system_keyspace::endpoint_dc_rack.
   - Kill trim() and split().
   - Added missing copyright and license statements.
   - _my_rack and _my_dc are not optional anymore.
   - Added a promiss that has to be set when snitch is stopped.
2015-06-09 15:33:38 +03:00
Vlad Zolotarov
a2594015f9 locator: futurize snitch creation
- Forbid explicit snitch creation with constructor.
   - Allow the creation of snitches only with locator::make_snitch() template
     function.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>

New in v4:
   - Make sure the snitch is stopped before it's destroyed when _snitch_is_ready
     is returned in an exceptional state.

New in v2:
   - Change snitch_ptr to be std::unique_ptr<i_endpoint_snitch>
   - abstract_replication_strategy::create_replication_strategy(): explicitly
     specify (template) types of create_object() parameters.
   - Re-arrange the loop in marge_keyspaces() so that lambdas that depend on
     "this" complete before there is a chance that "this" gets destroyed.
   - create_keyspace(): Don't add a new keyspace if a keyspace with this name
     already exists.
   - i_endpoint_snitch: added a stop() virtual method
      - Added a stop() pure virtual method.
      - Added an enum class snitch_state and a _state member initialized to snitch_state::initializing,
        added an assert() in a destructor requiring _state to become snitch_state::stopped,
        which should be set when stop() is complete.
   - rack_inferring_snitch: added a stop() method.
   - simple_snitch: added a stop() method.
   - Added stop() methods to abstract_replication_strategy and keyspace.
   - Updated database::stop() to wait for all keyspaces in _keyspaces to stop.
2015-06-09 15:33:38 +03:00