Commit Graph

1938 Commits

Author SHA1 Message Date
Avi Kivity
1d02b8bc6d Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-03-01 16:52:23 +02:00
Avi Kivity
27913013b1 virtio: tighten rx packets for debug mode
Allocate exactly the available fragment size in order to catch buffer
overflows.

We get similar behaviour in dpdk, since without huge pages, it must copy
the packet into a newly allocated buffer.
2015-03-01 16:42:07 +02:00
Gleb Natapov
590d8da4f1 core: provide "void" promise specialization
Makes it easier to write generic code.
2015-03-01 15:58:36 +02:00
Gleb Natapov
e1aa9f85a1 fix xenstore compilation 2015-03-01 15:29:13 +02:00
Avi Kivity
cefe6a9b3e tcp: fix option parsing
Two bugs:
  1. get_header<type>(offset) was used with size given as the offset
  2. opt_end failed to account for the mandatory tcp header, and thus was
     20 bytes to large, resulting in overflow.
2015-03-01 15:26:46 +02:00
Avi Kivity
f039904d75 Merge branch 'master' into db
Updated usages of std::hash<some_enum_type> to accomodate 25168fc73d.
2015-03-01 15:24:47 +02:00
Avi Kivity
25168fc73d enum: fix std::hash<> non-specialization for enum types
SFINAE only works for substituted template parameters, not any complication
error (or it would be called CEINAE); therefore hash<T> for enums will fail
to compile, given a non-enum, rather than being ignored.

It's not possible to specialize hash<> for enums, since the primary template
does not have en extra Enable template argument for use with enable_if.  We
therefore rename it to enum_hash<> and require users to explicitly define
hash<MyEnum> as inheriting from it.
2015-03-01 13:36:30 +02:00
Avi Kivity
1e5df06f9a shared_ptr: provide default std::hash<> specializations
Folloing std::shared_ptr.
2015-03-01 13:36:17 +02:00
Glauber Costa
eb384236fd iostream: extend eof condition to read_exactly users as well
We currently only signal eof for consume() users. If one is calling
read_exactly, eof will never be signalled.

This might make some sense in continuous streams, but specially when
dealing with files, eof is a natural part of line that can and will
happen all the time. Every "read-until-finish" file-loop will at some
point rely on eof.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-03-01 09:48:51 +02:00
Avi Kivity
81ca06fa36 sstable: fix TOC size check
Make sure we detect a too-large TOC correctly.
2015-02-28 23:50:36 +02:00
Avi Kivity
7441ce5b51 sstable: fix buffer overflow in TOC
boost::split() expects either a NUL terminated string or a proper container.
We give it neither.

Fix by wrapping the buffer in a string_view, which tells split() what size
the string is.
2015-02-28 23:49:07 +02:00
Avi Kivity
0b29e4bdaa Merge branch 'tgrabiec/db' of github.com:cloudius-systems/seastar-dev into urchin
Miscellaneous db changes, from Tomasz.
2015-02-28 22:33:06 +02:00
Tomasz Grabiec
74295a9759 db: Use opaque bytes for cell values instead of boost::any
Storing cells as boost::any objects makes us use expensive
boost::any_cast to access the data. This change replaces boost::any
with bytes object which holds the value in serialized form (the same
as will be used for on-wire format).

If the cell type is atomic, you use fields accessors defined in
atomic_cell class, eg like this:

if (column.type.is_atomic()) {
   if (atomic_cell::is_live(c) {
      auto timestamp = atomic_cell::timestamp(c);
      ...
   }
}

Eventually we could switch to a more officient semi-serialized form
with native byte order but I don't want to introduce it just yet for
simplicity.
2015-02-27 10:59:43 +01:00
Tomasz Grabiec
91176f469e schema: Add schema::all_columns_in_select_order()
After org.apache.cassandra.config.CFMetaData#allColumnsInSelectOrder
2015-02-27 10:48:56 +01:00
Tomasz Grabiec
1a0ffdfb99 schema: Encapsulate column sets 2015-02-27 10:48:56 +01:00
Tomasz Grabiec
a61d9ee18e schema: Add static columns to schema 2015-02-27 10:48:56 +01:00
Tomasz Grabiec
8b9078c86a schema: Make column_kind an enum class 2015-02-27 10:48:56 +01:00
Tomasz Grabiec
b77367dabe cql3: Simplify primary key membership checks 2015-02-27 10:48:56 +01:00
Tomasz Grabiec
609e893055 unimplemented: Separate subject from behavior
You can now do:

  fail(unimplemented::cause::PAGING);

and:

  warn(unimplemented::cause::PAGING);
2015-02-27 10:48:56 +01:00
Tomasz Grabiec
1f9d22f7e3 types: Fix read_simple*() variants to work for unaligned positions
Since types can be embedded at any position in memory we cannot assume
alignment.

Side note: It seems that on x86 access to the variable via packed<>
does not result in any extra instructions.
2015-02-27 10:48:56 +01:00
Tomasz Grabiec
00984609cb types: Add abstract_tyep::is_value_compatible_with() method 2015-02-27 10:48:56 +01:00
Tomasz Grabiec
f21d85cfc5 tests: Stop distributed db when test ends
Fixes:

cql_query_test: ./core/distributed.hh:150: distributed<Service>::~distributed() [with Service = database]: Assertion `_instances.empty()' failed.
2015-02-27 10:48:55 +01:00
Tomasz Grabiec
1dfc7267db cql3: Fix formatting in relation.hh 2015-02-27 10:46:05 +01:00
Avi Kivity
5bc8d7cfad build: speed up linking on large machines 2015-02-26 19:26:32 +02:00
Avi Kivity
a7132359a8 Merge branch 'glommer/sstables-v2' of github.com:cloudius-systems/seastar-dev into db
Sstable support from Glauber:

"These are the new sstable parsers, based on recursive templates.
They currently read the following files successfully:
 - Filter
 - Statistics
 - Compression
 - Summary (sans the indices, which are schema dependent)

The TOC file is also parsed, but slightly different because it contains
a newline separated list of strings. The CRC and Digest files are not
yet read, but they are only used for consistency checking, which can wait.

Aside from that, only missing the Data and Index files themselves."
2015-02-26 19:17:52 +02:00
Glauber Costa
8015b1c1bb sstable: unit tests
This tests the sstable parsing code. The tables provided as exemple are real
tables, that I was using to test my code manually.

The corrupt tables, however, are corrupted by hand.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-02-26 12:14:20 -05:00
Glauber Costa
fb3682cb4f sstable statistics file
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-02-26 12:14:19 -05:00
Glauber Costa
0d98caf885 summary file
TODO: read in the actual index. This is schema-dependent.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-02-26 12:14:19 -05:00
Glauber Costa
1b75a5bccb bloom filter
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-02-26 12:14:19 -05:00
Glauber Costa
d810f03bb7 compression file
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-02-26 12:14:19 -05:00
Glauber Costa
3e4ab6848b read toc
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-02-26 12:14:19 -05:00
Glauber Costa
cc4f8f09e5 parser: disk_hash type
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-02-26 12:06:25 -05:00
Glauber Costa
110facf479 parser: more basic types
bool, enum and double.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-02-26 12:06:25 -05:00
Glauber Costa
001606209a sstable parser
This is a parser for the sstable files based on template recursion.
With this, one can easily extend it to parse any complex data structure
by writing

    parse(in, struct.a, struct.b ... );

This patch contains the most basic types used during parsing as building
blocks.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-02-26 12:06:25 -05:00
Glauber Costa
b7281bd463 sstables: initial file
This represents an sstable with its multiple in-disk file. We don't yet
read any of them, though.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-02-26 12:06:25 -05:00
Glauber Costa
cb5c2de06c README: add documentation about then_wrapped
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-02-26 18:51:40 +02:00
Avi Kivity
ede9a5b634 build: enable native network stack for urchin 2015-02-26 18:49:28 +02:00
Avi Kivity
d39c844ea3 Merge branch 'master' of github.com:cloudius-systems/seastar into db
Conflicts:
	configure.py
	database.cc (added missing include)
	utils/serialize.hh (added missing inlines)
2015-02-26 17:57:18 +02:00
Tomasz Grabiec
1fadd7d608 net: Move ipv4_addr constructor to the source file
boost::join() provided by boost/algorithm/string.hpp conflicts with
boost::join() from boost/range/join.hpp. It looks like a boost issue
but let's not pollute the namespace unnecesssarily.

Regarding the change in configure.py, it looks like scollectd.cc is
part of the 'core' package, but it needs 'net/api.hh', so I added
'net/net.cc' to core.
2015-02-26 17:34:27 +02:00
Glauber Costa
6b77cf7d08 linecount: change rw to ro
Avi says it is enough.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-02-26 17:30:02 +02:00
Glauber Costa
9861bfca01 open_file_dma: allow the specification of open flags
It is sometimes frustrating to use open_file_dma, because it has the hardcoded
behavior of always assuming O_CREAT. Sometimes this is not desirable, and it
would be nice to have the option not to do so.

Note that, by design, I am only including in the open_flags enum things that we
want the user of the API to control. Stuff like O_DIRECT should not be
optional, and therefore is not included in the visible interface.

Because of that I am changing the function signature to include a paramater
that specifies whether or not we should create the file if it does not exist.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-02-26 17:30:02 +02:00
Nadav Har'El
4df5e6acff Start translating db/SystemKeyspace.java to C++
Only partially translated. I had to comment out some "static"
specifications to avoid compiler warnings because these are not used yet.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
2015-02-26 14:55:03 +01:00
Nadav Har'El
ede451b7f8 Add db/SystemKeyspace.java from origin
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-02-26 14:54:34 +01:00
Pekka Enberg
a3b2a70f65 tests/perf: CQL statement parser performance test
Add a performance test case for CQL statement parsing to better
understand its performance impact. We also include ANTLR tokenizer and
parser setup as that's what we do in query_processor for each request.

Running the test on my Haswell machine yields the following results:

  [penberg@nero urchin]$ build/release/tests/perf/perf_cql_parser
  Timing CQL statement parsing...
  108090.10 tps
  125366.11 tps
  124400.64 tps
  124274.75 tps
  124850.85 tps

That means that CQL parsing alone sets an upper limit of 120k requests
per second for Urchin for a single core.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-02-26 14:14:53 +01:00
Dor Laor
6f36fd48ad Tiny nitpicks in readme file 2015-02-26 13:07:50 +02:00
Dor Laor
381717a66e Run ispell on README.md 2015-02-26 13:07:37 +02:00
Dor Laor
1492ae9040 README: Add explanation about 100% cpu consumption and recommended configuration 2015-02-26 12:40:15 +02:00
Avi Kivity
76b19e920b Merge branch 'slab' of github.com:cloudius-systems/seastar-dev
Slabify memcached, from Raphael.
2015-02-26 11:49:11 +02:00
Tomasz Grabiec
cd7a05660e tests: Simplify schema object construction 2015-02-26 10:03:19 +02:00
Raphael S. Carvalho
67560bec48 test: Add slab allocator testcase
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-02-25 19:32:57 -03:00