Commit Graph

6789 Commits

Author SHA1 Message Date
Avi Kivity
c8cc8a0b0f Merge seastar upstream
* seastar 8207f2c...46fd389 (1):
  > rwlock: drop extranous '}'
2015-10-15 17:19:28 +03:00
Gleb Natapov
f37979eeff Make exception string generation code less verbose 2015-10-15 17:14:51 +03:00
Gleb Natapov
510ed4a1a0 Fix operator<< for std::exception_ptr to receive reference to an object 2015-10-15 17:14:50 +03:00
Avi Kivity
bd5ca7b998 Merge seastar upstream
* seastar a2523ae...8207f2c (3):
  > rwlock: provide lock / unlock semantics
  > with_lock: run a function under a lock
  > rwlock: add documentation to the rwlock module
2015-10-15 17:02:50 +03:00
Calle Wilund
7d93861b28 commitlog_test: test fix
Fixes spurious failures in test_commitlog_discard_completed_segments
* Do explicit sync on all segments to prevent async flushed from keeping
  segements alive.
* Use counter instead of actual file counting to avoid racing with
  pre-allocation of segments
2015-10-15 17:01:11 +03:00
Pekka Enberg
87fae37c9c dist/docker: Add missing "hostname" package
The Fedora base image has changed so we need to add "hostname" that's
used by the Docker-specific launch script to our image.

Fixes Scylla startup.

Signed-off-by: Pekka Enberg <penberg@scylladb.com>
2015-10-15 13:46:53 +03:00
Avi Kivity
a611a235ee Merge "Flush queue bugfixes" from Calle
"Fixes the crashes in debug mode with the flush queue test, and
simplifies and cleans up the queue itself.

Aforementioned crashes happened due to reordering with the signalling
loop in previous version. A task completing could race with a reordered
loop continuation in who would get to signal and remove an item.

Rewritten to use much simpler promise chaining instead (which also allows
return value to propagate from Pre- to post op), ensuring only one actor
modifies the queue entry."
2015-10-15 13:04:40 +03:00
Avi Kivity
67eb176029 Merge "Invalidate CQL prepared statements on schema changes" from Pekka
"This series converts MigrationSubscriber to C++ and wires it up to
invalidate CQL prepared statements on schema changes that affect them."
2015-10-15 11:44:13 +03:00
Pekka Enberg
e77fbfe709 cql3/query_processor: Wire up migration subscriber
Signed-off-by: Pekka Enberg <penberg@scylladb.com>
2015-10-15 09:18:53 +03:00
Pekka Enberg
f659e7bc10 cql3: Convert MigrationSubscriber to C++
Signed-off-by: Pekka Enberg <penberg@scylladb.com>
2015-10-15 09:18:52 +03:00
Pekka Enberg
3a30486d30 cql3/query_processor: Implement invalidate_prepared_statement()
Signed-off-by: Pekka Enberg <penberg@scylladb.com>
2015-10-15 09:18:52 +03:00
Pekka Enberg
c80deeb6fe cql3/query_processor: Add get_query_processor() helper
Signed-off-by: Pekka Enberg <penberg@scylladb.com>
2015-10-15 09:18:52 +03:00
Pekka Enberg
1890d276b9 cql3: Add depends_on_{keyspace|column_family} helper to cql_statement
Signed-off-by: Pekka Enberg <penberg@scylladb.com>
2015-10-15 09:18:52 +03:00
Calle Wilund
ea0f3504c2 flush_queue_test: Clean up and enhance the test a little
Now also tests:

* Value propagation
* Queue wait
2015-10-15 02:15:24 +02:00
Calle Wilund
cd9f5e38f7 flush_queue: Fix task reordering bug, simplify code, allow value propagation
Previous version dit looping on post execution and signaling of waiters.
This could "race" with an op just finishing if task reordering happened.

This version simplifies the code significantly (and raises the question why
it was not written like this in the first place... Shame on me) by simpy
building a promise-dependency chain between _previous_ queue items and next
instead.

Also, the code now handles propagation of return value from the "Func" pre-op
to the "Post" op, with exceptions automatically handled.
2015-10-15 02:10:26 +02:00
Avi Kivity
849464670c commitlog: make new segments more xfs-friendly
xfs doesn't like writes beyond eof (exactly at eof is fine), and due
to continuation reordering, we sometimes do that.

Fix by pre-truncating the segment to its maximum size.
2015-10-14 17:32:59 +03:00
Calle Wilund
206acd8b5b commitlog: Make reader handle pre-allocated files
Silently ignore, and assume eof if reading zeroed file or chunk header data
Reading entries already deal with this.
2015-10-14 17:32:23 +03:00
Calle Wilund
2729d5dd71 commitlog: ensure file size remains <= max_size
Re-check file size overflow after each cycle() call (new buffer),
otherwise we could write more, in the case we are storing a mutation
larger than current buffer size (current pos + sizeof(mut) < max_size, but
after cycle required by sizeof(mut) > buf_remain, the former might not be
true anymore.
2015-10-14 17:32:22 +03:00
Avi Kivity
6a31daffd6 Merge "Unify logged and unlogged batch write code paths" from Gleb
"Logic duplication bothered me for a long time. This series consolidates both
cases as much as possible."
2015-10-14 17:26:40 +03:00
Gleb Natapov
19770268be storage_proxy: use common write code to write batch log mutations.
Reworks write code further so it can be used to write batch log
mutations.
2015-10-14 17:12:57 +03:00
Gleb Natapov
db49a196da storage_proxy: remove code duplication between logged and unlogged batches
Currently logged batch has most of the logic on unlogged batch
duplicated. This patch rework unlogged batch code in such a way that
it can be reused.
2015-10-14 17:12:57 +03:00
Gleb Natapov
c6644d5721 storage_proxy: remove outdated comment 2015-10-14 17:12:57 +03:00
Gleb Natapov
77ceeee2a8 storage_proxy: move array instead of copy it. 2015-10-14 17:12:57 +03:00
Avi Kivity
77daa7a59f Merge "Flush queue ordering" from Calle
"Adds a small utility queue and through this enforces memtable flush ordering
such that a flush may _run_ unchecked, however the "post" operation may
execute once all "lower numbered" (i.e. lower replay position) post ops
has finished.

This means that:
a.) Callbacks to commitlog are now guaranteed to fulfill ordering criteria
b.) Calling column_family::flush() and waiting for the result will also
     wait for any previously initiated flushes to finish. But not those
     initiated _after_."
2015-10-14 15:13:24 +03:00
Calle Wilund
012ab24469 column_family: Add flush queue object to act as ordering guarantee 2015-10-14 14:07:40 +02:00
Calle Wilund
d8658d4536 flush_queue_test
Small test to verify at least some integrity of the util in question
2015-10-14 14:07:39 +02:00
Calle Wilund
4540036a01 Add "flush_queue" helper structure
Small utility to order operation->post operation
so that the "post" step is guaranteed to only be run
when all "post"-ops for lower valued keys (T) have been completed

This is a generalized utility mainly to be testable.
2015-10-14 14:07:38 +02:00
Avi Kivity
ed2481db7f Merge branch-0.10 2015-10-14 15:03:19 +03:00
Takuya ASADA
eb1924a4e4 dist: fix file not found error on centos_dep/build_dependency.sh
We don't have boost.diff, and doesn't need it. So return to rpmbuild --rebuild.

Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-10-14 14:12:46 +03:00
Asias He
c58ae5432c storage_service: Fix nodetool info return wrong gossiper status
Before:
$ nodetool info
ID                     : a5adfbbf-cfd8-4c88-ab6b-6a34ccc2857c
Gossip active          : false

After:
$ nodetool info
ID                     : a5adfbbf-cfd8-4c88-ab6b-6a34ccc2857c
Gossip active          : true

Fix #354.
2015-10-14 12:37:51 +03:00
Avi Kivity
1a439f2259 Merge seastar upstream
* seastar 78e3924...a2523ae (7):
  > core: fix pipe unread
  > Merge 'xfs-extents'
  > Merge "separate-dma-alignment"
  > output_stream: wait for stream to be taken out of poller in case final flush returns exception.
  > reactor: Use more widely compatible xfs include
  > readme: Add xfslibs-dev to Ubuntu deps
  > pipe: add unread() operation
2015-10-14 11:49:11 +03:00
Pekka Enberg
921dc9ab9f cql3: Add keyspace() and column_family() to select_statement
Signed-off-by: Pekka Enberg <penberg@scylladb.com>
2015-10-14 09:12:40 +03:00
Avi Kivity
cd6054253c Merge "fix consumer parser" from Raphael
Reviewed-by: Nadav Har'El <nyh@scylladb.com>
2015-10-13 18:53:27 +03:00
Raphael S. Carvalho
d05a5fbeb4 tests: add testcase for bug on consumer parser
problem described by commit:
3926748594

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-10-13 11:49:57 -03:00
Raphael S. Carvalho
3926748594 sstable: fix consumer parser
The first problem is the while loop around the code that processes prestate.
That's wrong because there may be a need to read more data before continuing
to process a prestate.
The second problem is the code assumption that a prestate will be processed
at once, and then unconditionally process the current state.
Both problems are likely to happen when reading a large buffer because more
than one read may be required.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-10-13 11:45:10 -03:00
Avi Kivity
c1cfec3e5a dht: mark boot_strapper logger static
Or it violates the ODR and causes link errors.
2015-10-13 16:42:42 +03:00
Tomasz Grabiec
11eb9a6260 range: Fix range::contains()
A range open-ended on both sides should contain all wrapping ranges.

Spotted by Avi.
2015-10-13 12:14:54 +03:00
Nadav Har'El
39f70a043d main: don't warn twice about the same directory
I was mildly annoyed by seeing two warnings about the same directory not
being XFS, when the sstable directory and the commitlog directory are the
same one (I don't know if this is typical, but this is what I do in all
my tests...). So I wrote this trivial patch to make sure not to test the
same directory twice.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-10-13 11:23:55 +03:00
Avi Kivity
eed11583cb Merge "Add node support" from Asias
"With this, a new node can stream data from existing nodes when joins the cluster.

I tested with the following:

  1) stat a node 1

  2) insert data into node 1

  3) start node 2

I can see from the logger that data is streamed correctly from node 1
to node 2."
2015-10-13 11:06:11 +03:00
Asias He
cf9d9e2ced boot_strapper: Enable range_streamer code in bootstrap
Add code to actually stream data from other nodes during bootstrap.

I tested with the following:

   1) stat a node 1

   2) insert data into node 1

   3) start node 2

I can see from the logger that data is streamed correctly from node 1
to node 2.
2015-10-13 15:54:18 +08:00
Asias He
0d1e5c3961 boot_strapper: Add debug info for get_bootstrap_tokens
Print the token generated for the node who is bootstrapping.
2015-10-13 15:48:53 +08:00
Asias He
e92a759dad locator: Add debug info for abstract_replication_strategy::get_address_ranges
It is useful to check relations between token and its primary range.
2015-10-13 15:46:36 +08:00
Asias He
dc02d76aee range_streamer: Implement fetch_async
It is used by boot_strapper::bootstrap() in bootstrap process to start
the streaming.
2015-10-13 15:45:56 +08:00
Asias He
887c0a36ec range_streamer: Implement add_ranges
It is used by boot_strapper::bootstrap() in bootstrap process.
2015-10-13 15:45:56 +08:00
Asias He
1c1f9bed09 range_streamer: Implement use_strict_sources_for_ranges 2015-10-13 15:45:55 +08:00
Asias He
43d4e62b5a range_streamer: Implement add_source_filter 2015-10-13 15:45:55 +08:00
Asias He
d47ea88aa8 range_streamer: Implement get_all_ranges_with_strict_sources_for 2015-10-13 15:45:55 +08:00
Asias He
84de936e43 range_streamer: Implement get_all_ranges_with_sources_for 2015-10-13 15:45:55 +08:00
Asias He
944e28cd6c range_streamer: Implement get_range_fetch_map 2015-10-13 15:45:55 +08:00
Asias He
d986a4d875 range_streamer: Add constructor 2015-10-13 15:45:55 +08:00