Commit Graph

5320 Commits

Author SHA1 Message Date
Glauber Costa
746fdc87b9 main: convert error messages to logger
Calling the logger 'main' may cause confusion to external readers not familiar
with the source code, since there is nothing 'main' about this logger in
particular - that is just the file name.

It is then called the start up log.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-02 10:44:50 +03:00
Avi Kivity
66d6e471ad Merge seastar upstream
* seastar beeaccb...3cf6bee (4):
  > dpdk: i40e_should_linearize(): Check the resulting cluster and not the original packet
  > reactor: fix inverted logic in recursive_touch_directory()
  > build: suport -march=... in cflags
  > tests: futures_test: Add test case for parallel_for_each()
2015-08-01 10:18:19 +03:00
Glauber Costa
9dcc926e92 create directory for commitlog
The same way we create a directory for the sstables, we should do it for the
commitlog.

If you, like me, have been using the --datadir directive, the fact that we
don't do it would have slipped away: when using --datadir, both the commitlog
and sstables will be put in this same root.

However, when using the system defaults from the configuration file, this won't
be true.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-01 10:14:32 +03:00
Glauber Costa
cb4a4e4ce3 schema: fix regular column count
There is a small but potentially serious mistake in the way we are computing
the number of regular columns. We are using an incorrect offset, and the
number of regular columns in a table like this:

    schema(...,
            {{"pk", utf8_type}},
            {{"ck", utf8_type}, {"ck2", utf8_type}},
            {
                {"reg1", long_type},
                {"reg2", long_type},
            },
            {{"static", utf8_type}},
            utf8_type,
            "comment"
    );

is being reported as 3.

Fix this

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-01 10:11:59 +03:00
Raphael S. Carvalho
6bc822dd71 db: fix problem with initialization of a column family
We should only call column_family::start after the checks because
if a check failed, column_family would be destroyed without
column_family::stop being called first, and that would lead to
a problem, such as _compaction_done future not being resolved.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-07-31 13:03:07 +03:00
Avi Kivity
465c03a8b5 Merge "gossip: cleanup" from Asias 2015-07-31 13:01:54 +03:00
Avi Kivity
834fd67567 Merge "streaming: improve stream completion" from Asias 2015-07-31 12:59:32 +03:00
Tomasz Grabiec
679b71e79f unimplemented: Use logger 2015-07-31 12:58:16 +03:00
Asias He
804564fe76 streaming: Remove completed stream in stream_manager 2015-07-31 16:27:55 +08:00
Asias He
90ec97743b streaming: Introduce get_stream_result_future
Stream manager tracks two kind of streams: initiated or receiving. Give
a plan_id, search both lists to get a stream_result_future instance.
2015-07-31 16:27:55 +08:00
Asias He
1749305165 streaming: Fix stream_result_future::create_and_register
It is used to create stream initiated by us.
2015-07-31 16:27:55 +08:00
Asias He
588da78574 streaming: Introduce stream_manager::get_sending_stream
Return streams initiated by us.
2015-07-31 16:27:55 +08:00
Asias He
4d12f40b8a streaming: Implement stream_manager::register_sending
It is used to track streams initiated by us.
2015-07-31 16:27:55 +08:00
Asias He
59cae82470 streaming: Make stream_plan::execute return a future
Returns a ready future if the stream_plan completes successfully, or a
failed future otherwise.
2015-07-31 16:27:55 +08:00
Asias He
3a5af0a7fb streaming: Fix stream_coordinator::is_receiving
Unlike Origin, We can not use _connections_per_host == 0 to indicate we
are a follower since we set _connections_per_host to 1 for follower too.
2015-07-31 16:27:55 +08:00
Asias He
67acaf1a79 streaming: Convert StreamException.java to C++ 2015-07-31 16:27:55 +08:00
Asias He
8864d0c25c streaming: Import StreamException.java 2015-07-31 16:27:55 +08:00
Asias He
eaa3fd299b logger: Align log level 2015-07-31 16:27:55 +08:00
Asias He
eb79a119bf gossip: Move code from gms/gossip_digest_syn.hh to source file 2015-07-31 10:43:40 +08:00
Asias He
175ccfe49d gossip: Move code from gms/gossip_digest_ack2.hh to source file 2015-07-31 10:43:40 +08:00
Asias He
3ad6d1309f gossip: Move code from gms/gossip_digest_ack.hh to source file 2015-07-31 10:43:40 +08:00
Asias He
6398bb4bdc gossip: Move code from gms/endpoint_state.hh to source file 2015-07-31 10:43:40 +08:00
Asias He
b1a8353e61 gossip: Drop gms/token_serializer.hh
It is unused.
2015-07-31 10:43:40 +08:00
Asias He
a95213e81e gossip: Kill gms/gms.cc
All headers of gms/* are included. No need to include them all in gms.cc now.
2015-07-31 10:43:40 +08:00
Asias He
e074b1b7f8 gossip: Move operator<< of gossip_digest_ack2 to gossip_digest_ack2.cc 2015-07-31 10:43:39 +08:00
Asias He
ca5eea7fad gossip: Move operator<< of gossip_digest_ack to gossip_digest_ack.cc 2015-07-31 10:43:39 +08:00
Asias He
76efae87b5 gossip: Move operator<< of gossip_digest_syn to gossip_digest_syn.cc 2015-07-31 10:43:39 +08:00
Asias He
d850e4ef31 gossip: Move _the_gossiper to gossiper.cc 2015-07-31 10:43:39 +08:00
Asias He
4390b448a2 gossip: Move _the_failure_detector to failure_detector.cc
We will kill gms/gms.cc soon.
2015-07-31 10:43:39 +08:00
Asias He
d4dce4aa43 gossip: Fix is_enabled 2015-07-31 10:43:39 +08:00
Asias He
5d08bd030c gossip: Kill one more unimplemented in shutdown 2015-07-31 10:43:39 +08:00
Asias He
efbdf428fc gossip: Remove commented code of resetVersion and destroyConnectionPool
Our messaging service is completely different. No need to reset version
or destroy connection pool.
2015-07-31 10:43:39 +08:00
Asias He
43c7ff217d gossip: Kill two warn unimplemented
It is implemented now.
2015-07-31 10:43:39 +08:00
Nadav Har'El
499014a486 main: exit on exception
Our main has a "on_terminate()" to make sure it exits when there is an
exception during initialization, instead of hanging. But it's in the
wrong place - it needs to be on the outer future.

Before this patch, an error parsing the command line will result in
a "WARNING: exceptional future ignored ..." and a hang, instead of a
"Exiting on unhandled exception..." and an exit as we get after this
patch.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-07-30 19:32:52 +03:00
Avi Kivity
53ed89c4d9 Merge seastar upstream
* seastar 732dba1...beeaccb (4):
  > future: fix parallel_for_each returning to quickly on error
  > tests: add test case for parallel_for_each early return on error
  > net::dpdk::i40e_should_linearize(): Don't assume that all headers are in frag0
  > net::dpdk: rename max_non_tso_i40e_frags
2015-07-30 19:12:07 +03:00
Paweł Dziepak
6f0af11051 mutation_partition: row_marker: fix operator==()
If row marker is missing _ttl and _expiry are meaningless.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 17:58:30 +03:00
Tomasz Grabiec
2ce49343a4 Merge branch 'pdziepak/row-ttl/v3' from seastar-dev.git
Handling row marker expiry from Pawel:

This series fixes row expiration. Row markers are used to make sure that
row exists even if it has no cells and therefore they also need to be
expired properly. Origin gets that for free since in their architecture
row marker is a normal cell. We use different approach with deletable_row
storing marker information and therefore additional logic must be added
to make sure that expiration works correctly.
2015-07-30 14:31:54 +02:00
Paweł Dziepak
6121fded85 tests/cql3: add more ttl tests
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
9300457df7 mutation_partition: drop deletable_row::apply(api::timestamp_type)
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
690e9b55f4 cql3: set proper expiration of row marker
INSERT statements update row marker ttl and expiry to the same values
which are set to the added/modified cells.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
430f74a8bb sstables: read expired or expiring row marker
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
f5e3764570 sstables: properly write expiring row marker
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
32b9879a34 mutation_partition: apply row marker in apply()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
39c8e29566 mutation_partition: try to compact and expire row marker
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
11e1d82403 mutation_partition: serialize row_marker of deletable_row
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
c84763d434 mutation_partition: use row_marker in deletable_row
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
ed21fd1ef8 mutation_partition: add row_marker class
Row marker can be in one of three states: missing, live (possibly
expiring) or dead. Since it basically behaves like a normal cell, except
it doesn't have any value, row_marker class provides an interface
similar to atomic_cell.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
f5fff734ed cq3: update_parameters: add getters for ttl and expiry
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
53be987a6d db: read default ttl from legacy schema tables
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:10:06 +02:00
Paweł Dziepak
87916612bd cql3: set default time to live when building schema
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-30 14:09:00 +02:00