Commit Graph

385 Commits

Author SHA1 Message Date
nick
f4793c7059 bitset: Rename bitset_mapping to bitset 2013-09-23 16:58:40 +01:00
nick
0f0697a0aa serve: Remove an unused (and incorrect, in any case) function 2013-09-23 16:47:32 +01:00
nick
e98c2f2f05 serve: Fix the sense of allow/forbid_new_clients
We need a migration test where more clients connect after the gong
2013-09-23 16:46:43 +01:00
nick
ebe6c4a8ab mirror: Remove dead code. We still rely on all_dirty in one place. 2013-09-23 14:20:05 +01:00
nick
847b2ec9ad status: Remove useless stats 2013-09-23 14:19:49 +01:00
nick
ca9aea0d13 status: Expose migration_seconds_left 2013-09-23 14:09:25 +01:00
nick
0ae249009c serve/mirror: Move some code tracking migration speed into serve
The rationale is that status will need this information
2013-09-23 13:49:01 +01:00
nick
0f2225becf status: Display number of currently connected clients, and whether new clients are allowed
These will be useful for migration status monitoring - replaces "is pass == 7?"
2013-09-23 13:38:19 +01:00
nick
a6c175ed1d serve: Allow number of clients currently being used to be counted 2013-09-23 13:37:13 +01:00
nick
94654419c5 serve: Add a comment clarifying that a behaviour is safe 2013-09-23 10:53:55 +01:00
nick
e161121c7a flexnbd: Remove unused ".INCOMPLETE" file code
The original idea was that we'd create a .incomplete file at the destination
for mirroring, but that code was removed some time ago. This is all dead, now
2013-09-23 10:38:18 +01:00
nick
150e506780 flexnbd: Remove the server I/O lock as it no longer has any consumers 2013-09-23 10:29:06 +01:00
nick
9a3106f946 flexnbd: Remove the server I/O lock from around NBD requests
NBD doesn't actually guarantee what happens if you have two
concurrent writes to overlapping areas of the disc, and this
mutex was causing us a near-deadlock when the TCP connection
died uncleanly, partway through a request. So now we don't
bother. This actually removes the last user of the server I/O
mutex, so we can remove it completely from the codebase in a
future commit.
2013-09-23 10:22:48 +01:00
nick
71036730c4 Fix a warning in a test 2013-09-23 10:17:50 +01:00
nick
6553907972 mirror: Fix mirroring, break status
This removes the concept of 'passes' completely from mirror.c,
although it leaves the relevant bits in mirror.h to keep status from
failing - although its current code is now Wrong. FIXME.

We also now get the previous test passing, meaning mirroring works
again.
2013-09-20 17:08:14 +01:00
nick
9770bbe42b tests: Fix for the previous commit 2013-09-20 16:53:30 +01:00
nick
6ffa10bf89 flexnbd: Make a test a bit stricter 2013-09-20 16:00:56 +01:00
nick
eb80c0d235 mirror: Remove server I/O lock and dirty map
Given our bitset_stream events, we no longer need to worry about
keeping track of the dirty map. This also lets us rip out the
server I/O lock from mirroring.

It's possible that we can remove the lock from client.c as well at
this point, but I need to have a bit more of a think about possible
races
2013-09-19 15:18:30 +01:00
nick
a5c296f948 mirror: Fix a comment 2013-09-18 16:28:05 +01:00
nick
77a66c85a0 serve: Move bitset freeing to after closing the mirror and clients 2013-09-17 17:30:33 +01:00
nick
0172eb1cba flexnbd: Some comments and a minor fix in client.c to do with the event stream 2013-09-13 15:17:15 +01:00
nick
c3a5eb0600 bitset: add bitset_stream_size and bitset_stream_queued_bytes 2013-09-12 16:54:42 +01:00
nick
0a029fbbf5 bitset: Add an event stream implementation
Nothing is using it yet
2013-09-12 12:30:50 +01:00
nick
83426e1c01 tests: Update check_bitset to use new bitset_free() function 2013-09-11 16:09:27 +01:00
nick
86a000c717 bitset: Some whitespace changes 2013-09-11 15:48:19 +01:00
nick
54a41aacdf bitset: Add a bitset_free() function 2013-09-11 14:41:59 +01:00
nick
487bef1f40 flexnbd: Disconnect clients at the start of a mirror last pass
Currently, we prevent clients from processing requests by taking
the server I/O lock. This leads to requests hanging for a long
time before being terminated when the migration completes, which
is not ideal. With this change, at the start of the final pass,
existing clients are closed and any new connections will be closed
immediately (so no NBD server handshake will be seen).

This is part of the work required to remove remove the server I/O
lock completely.
2013-09-10 16:03:26 +01:00
nick
0494295705 mirror: Ensure the mirror client socket is closed after a fail, and before a retry 2013-08-27 15:54:59 +01:00
nick
14fde0f2a1 mirror: Remove overly-verbose log line 2013-08-21 14:41:19 +01:00
nick
e13d1d8fb4 mirror: honour max_bytes_per_second - naive scheme
If we're above max_bytes_per_second once we've finished a transfer
(8MB chunks, worst-case) then we delay the next transfer until
all_dirty_bytes / duration < max_bytes_per_second - checking once
per second.

If this isn't good enough, we can improve it - leaky bucket is one
option. To begin with, though, we'll mostly be using this to set
max_bps to either 0 or 100MB/sec or so. So it should be fine.
2013-08-14 16:24:50 +01:00
nick
efdd613968 listen: Turn off CLIENT_MAX_WAIT_SECS
The idea behind this feature was to avoid the client thread in a listen
server getting stuck forever if the mirroring thread in the source died.
However, it breaks any sane implementation of max_Bps in that thread,
and there are lingering concerns over how it might operate under normal
conditions anyway.

Specifically, if iterating over the bitmap takes a long time, or even just
reading the requisite 8MB from the disc in order to send it, then the
5-second timeout could be hit, causing mirroring to fail unnecessarily.
2013-08-14 16:09:55 +01:00
nick
d0022402ae mirror: Start our timeout watcher from the first, not second, transfer 2013-08-14 15:29:24 +01:00
nick
28fff91af1 flexnbd: add a mirror-speed command to change mirror->max_bytes_per_second
It's not actually honoured yet, and ideally, you'd also be able to set it as
part of the initial setup: "flexnbd mirror ... -m 4G". remote_argv for the
mirror case would need to become x=y z=w format first, though.
2013-08-14 13:33:02 +01:00
nick
385c9027db flexnbd status: display mirror->max_bytes_per_second as mirror_speed_limit 2013-08-14 13:30:25 +01:00
nick
b73081e417 One more fix 2013-08-13 16:22:44 +01:00
nick
cc468b0b17 control/mirror: Use uint64_t and strtoull to get max_Bps into the mirror 2013-08-13 12:30:18 +01:00
nick
7128fcc901 control: Output abandoned mirror state 2013-08-13 12:29:53 +01:00
nick
45355666f7 mirror: And another abandon fix 2013-08-12 16:14:53 +01:00
nick
8a294e5ee0 mirror: fix abandon 2013-08-12 15:54:49 +01:00
nick
c6764b0de1 mirror: abandon signals are now honoured outside of the remote end being readable / writable 2013-08-12 15:30:21 +01:00
nick
41facd2ccf Branch merge 2013-08-09 17:07:06 +01:00
nick
f6456349f7 Backed out changeset e58ff57b5e2d
Slows tests down
2013-08-09 17:06:56 +01:00
nick
9f4fbe782c Branch merge 2013-08-09 17:03:25 +01:00
nick
8c750a5e9d listen: Allow longer gaps between transfers 2013-08-09 17:02:58 +01:00
nick
64702d992d Minor fixes here and there 2013-08-09 17:02:33 +01:00
nick
c2df38c9d3 mirror: Use libev to provide an event loop inside the mirror thread
We're doing this so we can implement bandwidth controls sanely.
2013-08-09 17:02:10 +01:00
nick
754949d43f bitset: Add a bitset_run_count_ex that lets you learn the value of the bits in the run 2013-08-09 16:49:38 +01:00
lupine
1a966ca0be bitset: Prove that bitset operations with len=0 don't underflow 2013-07-26 17:09:21 +01:00
nick
f590f8ed3c status: Add migration_speed ( bytes per second ) and migration_duration( seconds ) to the migration output 2013-07-26 11:50:01 +01:00
nick
bc9ce93648 bitset: squash one more bug 2013-07-25 10:58:50 +01:00