Commit Graph

283 Commits

Author SHA1 Message Date
nick
1d9f055dc7 Turn a couple of FIXME fatals in readwrite.c into warnings 2013-02-28 12:07:21 +00:00
nick
e659a78855 proxy: Fix the return value of a function to match the comment 2013-02-25 15:53:19 +00:00
nick
78299de299 Dummy commit to get past a merge commit 2013-02-21 13:57:33 +00:00
nick
6842864e74 Automated merge with file:///home/lupine/Development/bigv-repos/flexnbd-c-sockutil 2013-02-15 16:53:18 +00:00
nick
98d8fbeaf0 flexnbd: Add a proxy mode
This lets us proxy connections between NBD clients and servers, resiliently.
2013-02-15 16:52:16 +00:00
nick
9b67d30608 serve: Make some error conditions non-fatal, test them.
We don't want flexnbd serve to fall over and die if the client sends an invalid request.
2013-02-15 16:51:28 +00:00
nick
63f7e3e8d4 Fix some sockutil tests 2013-02-15 16:48:23 +00:00
nick
9826dc6c65 Automated merge with ssh://dev/flexnbd-c 2013-02-15 13:36:15 +00:00
nick
0324d3000d branch merge 2013-02-15 13:35:42 +00:00
nick
91085b87fc flexnbd: Add valgrind suppressions for a bug in glibc-2.11 2013-02-15 13:35:21 +00:00
nick
dfa7e1a21b serve: Don't die horribly in the event of EINTR being returned by select() 2013-02-14 16:38:45 +00:00
nick
8281809f42 flexnbd: Fix sock_try_bind so we don't retry on EADDRINUSE 2013-02-14 16:37:14 +00:00
nick
03bc12dd57 flexnbd read/write: Switch to a non-blocking connect() to allow us to time these out 2013-02-14 16:24:10 +00:00
nick
58c4a9530b Make acceptance tests verbose by default 2013-02-14 11:17:44 +00:00
nick
cb7eed28e7 sockutil: Add some tests for sockaddr_address_string 2013-02-13 15:07:30 +00:00
nick
ac560bd907 serve: Refactor some socket utility code into its own module.
We'll be using this in proxy mode later
2013-02-13 13:43:52 +00:00
nick
0fcbe04f80 flexnbd: Remove some obsolete 'rebind' options
They steal short options that I want for other things
2013-02-13 13:11:20 +00:00
nick
f63be84d80 flexnbd: Add some more information to nbdtypes.h 2013-02-08 17:05:22 +00:00
nick
8c04564645 flexnbd: Avoid a SIGSEGV when the allocation map fails to build.
In the event of a fiemap ioctl failing (when the file is on a tmpfs,
for instance), we would free() serve->allocation_map, but it would
remain not NULL, leading to segfaults in client.c when responding to
write requests.

Keeping the free() behaviour is more hassle than it's worth, as there
are synchronization problems with setting serve->allocation_map to
NULL, so we just omit the free() instead to avoid the segfault. This
is safe because we never consult the map until allocation_map_built is
set to true, and we never do that when the builder thread fails.
2013-02-08 16:17:16 +00:00
nick
ecfd108a53 Introduce socket_nbd_write_hello() and a macro to display errno results nicely 2013-02-08 15:53:27 +00:00
nick
56ce7d35c2 Add a debug message for cases where sendfile() fails 2013-02-06 14:41:49 +00:00
nick
2dd3db95bc Automated merge with file:///home/zander/00-projects/17-bigv/new-trial/src/incoming/flexnbd-c 2013-02-06 12:17:40 +00:00
nick
184a13bc9f Add an all-debug task to the makefile 2013-02-05 13:46:55 +00:00
nick
0b3a71bb03 flexnbd: Allocate the right amount of memory for a struct client 2013-02-05 13:27:48 +00:00
nick
719bd30071 Add a minimal Makefile that lets 'make' and 'make clean' do the Right Thing 2013-02-05 09:44:59 +00:00
nick
1afba29b63 flexnbd: Normalise some variable declarations 2013-02-01 15:20:43 +00:00
nick
7583ffbc4d flexnbd: constantize the quiet log level 2013-02-01 15:06:47 +00:00
Alex Young
f002b8ca1f madvise after mirroring to control the RSS 2012-12-28 11:38:54 +00:00
Alex Young
00d7237f66 Remove an errant debug output from test_happy_path.rb 2012-11-21 09:26:12 +00:00
Alex Young
ed70dacf2f Don't skip parts of a file when calling fiemap
A mis-incremented offset in the fiemap-processing code meant that
non-sparse portions of files were missed.
2012-11-20 17:24:19 +00:00
Alex Young
4f650d85c2 Fix the error message for flexnbd write --help 2012-11-20 15:09:48 +00:00
Alex Young
dcef6d29e5 Allocate the bitset in the foreground thread.
This prevents the possibility of a race in dereferencing it in the
client threads.
2012-10-09 17:54:00 +01:00
Alex Young
22bea81445 Don't open the control socket until after the server socket is bound
This makes it easier for the tests (and supervisor) to guarantee to be
able to connect to the server socket.

Also this patch moves freeing the mirror supervisor into the server
thread.
2012-10-09 17:35:20 +01:00
Alex Young
83eb31aba4 Merge 2012-10-09 17:28:41 +01:00
Alex Young
161d2fccf1 Rename serve->has_control to serve->success.
This makes the use of this variable to signal an unexpected SIGTERM
while migrating less confusing.
2012-10-09 17:20:39 +01:00
mbloch
029ebb5ef4 Fixed build_allocation_map in ioutil.c to correctly traverse fiemaps where
there are more than 1000 extents in a 100MB file chunk.
2012-10-08 18:11:21 +01:00
Alex Young
a039ceffcb Merge 2012-10-08 16:02:37 +01:00
Alex Young
062ecca1fd Backed out changeset c25e7d82e56e
This causes test failures under valgrind, and we don't need the
reordering with a background allocation map builder.
2012-10-08 16:01:25 +01:00
Alex Young
cf62b10adf Nullcheck *before* dereferencing.
Also bracketing, replacing a lost comment, and some variable naming.
2012-10-08 14:54:10 +01:00
Matthew Bloch
a49cf14927 Block allocation map is now built in a separate thread, and does not delay
server startup (sparse write avoidance doesn't happen until it is finished).
Added mutex to bitset functions, which were already being called from
multiple threads.  Rewrote allocation map builder to request file
information in multiple chunks, to avoid uninterruptible wait and dynamic
memory allocation.
2012-10-07 21:55:01 +01:00
Matthew Bloch
7b13964c39 Update Rakefile to support locally-installed libcheck, removed efence, pushed
-l arguments to end of link command line.
2012-10-07 02:09:34 +01:00
Alex Young
1fa8ba82a5 Merge 2012-10-04 14:51:54 +01:00
Alex Young
f3e0d61323 Quit with an error status on SIGTERM during migration
This prevents the supervisor from thinking that the migration completed
successfully.

In order to do this, I've introduced a new lock around the start (and
finish) of the migration so that we avoid a race between the signal
handler in the server_accept loop and the control thread mirror startup.
Without that, we'd risk successfully starting a migration after the
SIGTERM handler fired, which would be Bad.
2012-10-04 14:41:55 +01:00
nick
32cae67a75 flexnbd: Move building the allocation map to before server socket bind()
Building the allocation map takes time, which scales with the size of the disc
being presented. By building that map in the space between bind() and accept(),
we leave the process in a useless state after the only good signal we have for
"we are ready" and the state where it is actually ready. This was breaking
migrations of large files.
2012-09-25 11:47:44 +01:00
nick
ccbfce1075 Whitespace 2012-09-20 13:37:48 +01:00
Alex Young
ddc57e76d1 Remove an unneeded sanity check from the tests 2012-09-13 15:13:20 +01:00
Alex Young
1d9c88d4ca Add the write-during-migration test to the acceptance test run 2012-09-13 14:41:50 +01:00
Alex Young
8b43321ef2 Fix for deadlocks when writing while migrating 2012-09-13 12:21:43 +01:00
nick
13328910c8 Add a test case that tickles a deadlock bug when migrating active source discs 2012-09-12 17:13:33 +01:00
Alex Young
50001cd6e7 Merge 2012-09-12 15:43:15 +01:00