Dimitry Andric
6130c10567
Use NO_WCAST_ALIGN for usr.bin/hastctl and usr.bin/hastd; the alignment
...
warnings in sbin/hastd/lzf.c are only emitted for i386 and amd64, and
there they can be safely ignored.
MFC after: 1 week
2011-12-19 15:46:15 +00:00
Pawel Jakub Dawidek
8a605b3f64
Use lex's standard way of not generating unused function.
...
Inspired by: r228555
MFC after: 1 week
2011-12-18 20:41:58 +00:00
Pawel Jakub Dawidek
b6afd24f2b
Don't use function name as format string.
...
Detected by: clang
MFC after: 1 week
2011-12-18 20:40:19 +00:00
Pawel Jakub Dawidek
f59936d642
Remove redundant assignment.
...
Found by: Clang Static Analyzer
MFC after: 1 week
2011-12-15 22:05:23 +00:00
Pawel Jakub Dawidek
8c63ee4ff7
Simplify code by changing functions types from int to avoid, as the functions
...
always return 0.
Found by: Clang Static Analyzer
MFC after: 1 week
2011-12-15 22:03:17 +00:00
Pawel Jakub Dawidek
b720f4aad0
Remove redundant setting of the error variable.
...
Found by: Clang Static Analyzer
MFC after: 1 week
2011-12-15 22:01:34 +00:00
Pawel Jakub Dawidek
0ebcf9e6cb
Remove redundant space.
...
MFC after: 3 days
2011-10-27 20:36:35 +00:00
Pawel Jakub Dawidek
07ebc3626e
Implement 'async' mode for HAST.
...
MFC after: 3 days
2011-10-27 20:32:57 +00:00
Pawel Jakub Dawidek
3f5bce1822
Minor cleanups.
...
MFC after: 3 days
2011-10-27 20:15:37 +00:00
Pawel Jakub Dawidek
43b8675beb
Reduce indentation.
...
MFC after: 3 days
2011-10-27 20:13:39 +00:00
Pawel Jakub Dawidek
5a58d22a84
Improve comment so it doesn't suggest race is possible, but that we handle
...
the race.
MFC after: 3 days
2011-10-27 20:10:21 +00:00
Pawel Jakub Dawidek
949350bb1f
- Eliminate the need for hio_nv.
...
- Introduce hio_clear() function for clearing hio before returning it
onto free queue.
MFC after: 3 days
2011-10-27 20:01:23 +00:00
Pawel Jakub Dawidek
1212a85c4a
Monor cleanups.
...
MFC after: 3 days
2011-10-27 18:49:16 +00:00
Pawel Jakub Dawidek
8a34134ac2
Delay resuid generation until first connection to secondary, not until first
...
write. This way on first connection we will synchronize only the extents that
were modified during the lifetime of primary node, not entire GEOM provider.
MFC after: 3 days
2011-10-27 18:45:01 +00:00
Pawel Jakub Dawidek
982369192e
Correct comments.
...
MFC after: 3 days
2011-10-27 16:22:17 +00:00
Pawel Jakub Dawidek
bd738d630c
Allow to specify pidfile in HAST configuration file.
...
MFC after: 1 week
2011-10-17 12:22:09 +00:00
Pawel Jakub Dawidek
89da1a23cd
Remove redundant space.
...
MFC after: 1 week
2011-10-17 09:59:04 +00:00
Pawel Jakub Dawidek
6fea20e297
When path to the configuration file is relative, obtain full path,
...
so we can always find the file, even after daemonizing and changing
working directory to /.
MFC after: 1 week
2011-10-17 09:54:07 +00:00
Pawel Jakub Dawidek
e3feec94eb
Correct typo.
...
MFC after: 3 days
2011-09-28 13:25:27 +00:00
Pawel Jakub Dawidek
12daf727f6
If the underlying provider doesn't support BIO_FLUSH, log it only once
...
and don't bother trying in the future.
MFC after: 3 days
2011-09-28 13:19:47 +00:00
Pawel Jakub Dawidek
39852ce89e
Break a bit earlier.
...
MFC after: 3 days
2011-09-28 13:13:43 +00:00
Pawel Jakub Dawidek
518dd4c0d9
After every activemap change flush disk's write cache, so that write
...
reordering won't make the actual write to be committed before marking
the coresponding extent as dirty.
It can be disabled in configuration file.
If BIO_FLUSH is not supported by the underlying file system we log a warning
and never send BIO_FLUSH again to that GEOM provider.
MFC after: 3 days
2011-09-28 13:08:51 +00:00
Pawel Jakub Dawidek
adf8002bac
Use PJDLOG_ASSERT() and PJDLOG_ABORT() everywhere instead of assert().
...
MFC after: 3 days
2011-09-27 08:50:37 +00:00
Pawel Jakub Dawidek
be1143efb9
No need to wrap pjdlog functions around with KEEP_ERRNO() macro.
...
MFC after: 3 days
2011-09-27 08:26:09 +00:00
Pawel Jakub Dawidek
7f46e21d82
- Convert some impossible conditions into assertions.
...
- Add missing 'if' in comment.
MFC after: 3 days
2011-09-27 08:04:01 +00:00
Pawel Jakub Dawidek
09c2e8431a
Correct two mistakes when converting asserts to PJDLOG_ASSERT()/PJDLOG_ABORT().
...
MFC after: 3 days
2011-09-27 07:59:10 +00:00
Pawel Jakub Dawidek
571fdd7e47
Prefer PJDLOG_ASSERT() and PJDLOG_ABORT() over assert() and abort().
...
pjdlog versions will log problem to syslog when application is running in
background.
MFC after: 3 days
2011-09-27 07:57:15 +00:00
Pawel Jakub Dawidek
1ebc0407fc
No need to use KEEP_ERRNO() macro around pjdlog functions, as they don't
...
modify errno.
MFC after: 3 days
2011-09-27 07:52:39 +00:00
Pawel Jakub Dawidek
80c9ebc27e
Ensure that pjdlog functions don't modify errno.
...
MFC after: 3 days
2011-09-27 06:43:51 +00:00
Mikolaj Golub
adca96f861
Fix indentation.
...
Approved by: pjd (mentor)
2011-07-13 05:32:55 +00:00
Mikolaj Golub
0687d71e40
Remove useless initialization.
...
Approved by: pjd (mentor)
MFC after: 3 days
2011-07-05 06:12:28 +00:00
Mikolaj Golub
d9f039e0b3
Check the returned value of activemap_write_complete() and update matadata on
...
disk if needed. This should fix a potential case when extents are cleared in
activemap but metadata is not updated on disk.
Suggested by: pjd
Approved by: pjd (mentor)
2011-06-28 21:01:32 +00:00
Mikolaj Golub
aa64b2f494
Make activemap_write_start/complete check the keepdirty list, when
...
stating if we need to update activemap on disk. This makes keepdirty
serve its purpose -- to reduce number of metadata updates.
Discussed with: pjd
Approved by: pjd (mentor)
2011-06-28 20:57:54 +00:00
Pawel Jakub Dawidek
a6de1e5c85
Compile hastd and hastctl with capsicum support.
...
X-MFC after: capsicum merge
2011-06-27 09:15:41 +00:00
Pawel Jakub Dawidek
699b26bdce
Compile capsicum support only if HAVE_CAPSICUM is defined.
...
MFC after: 3 days
2011-06-27 09:14:25 +00:00
Pawel Jakub Dawidek
133d75ed18
Log a warning if we cannot sandbox using capsicum, but only under debug level 1.
...
It would be too noisy to log it as a proper warning as CAPABILITIES are not
compiled into GENERIC by default.
MFC after: 3 days
2011-06-27 09:10:48 +00:00
Mikolaj Golub
ba2a822490
In HAST we use two sockets - one for only sending the data and one for
...
only receiving the data. In r220271 the unused directions were
disabled using shutdown(2).
Unfortunately, this broke automatic receive buffer sizing, which
currently works only for connections in ETASBLISHED state. It was a
root cause of the issue reported by users, when connection between
primary and secondary could get stuck.
Disable the code introduced in r220271 until the issue with automatic
buffer sizing is not resolved.
Reported by: Daniel Kalchev <daniel@digsys.bg>, danger, sobomax
Tested by: Daniel Kalchev <daniel@digsys.bg>, danger
Approved by: pjd (mentor)
MFC after: 1 week
2011-06-17 07:07:26 +00:00
Maxim Sobolev
e0455434b4
Revert r222688.
...
Requested by: Mikolaj Golub
2011-06-16 08:31:06 +00:00
Maxim Sobolev
98453c81af
Read from the socket using the same max buffer size as we use while
...
sending. What happens otherwise is that the sender splits all the
traffic into 32k chunks, while the receiver is waiting for the whole
packet. Then for a certain packet sizes, particularly 66607 bytes in
my case, the communication stucks to secondary is expecting to
read one chunk of 66607 bytes, while primary is sending two chunks
of 32768 bytes and third chunk of 1071. Probably due to TCP windowing
and buffering the final chunk gets stuck somewhere, so neither server
not client can make any progress.
This patch also protect from short reads, as according to the manual
page there are some cases when MSG_WAITALL can give less data than
expected.
MFC after: 3 days
2011-06-04 16:01:30 +00:00
Mikolaj Golub
a01a750f32
If READ from the local node failed we send the request to the remote
...
node. There is no use in doing this for synchronization requests.
Approved by: pjd (mentor)
MFC after: 1 week
2011-05-29 21:20:47 +00:00
Pawel Jakub Dawidek
3db86c39ae
Keep statistics on number of BIO_READ, BIO_WRITE, BIO_DELETE and BIO_FLUSH
...
requests as well as number of activemap updates.
Number of BIO_WRITEs and activemap updates are especially interesting, because
if those two are too close to each other, it means that your workload needs
bigger number of dirty extents. Activemap should be updated as rarely as
possible.
MFC after: 1 week
2011-05-23 21:15:19 +00:00
Pawel Jakub Dawidek
1c6689d58d
To handle BIO_FLUSH and BIO_DELETE requests in secondary worker we need
...
to use ioctl(2). This is why we can't use capsicum for now to sandbox
secondary. Capsicum is still used to sandbox hastctl.
MFC after: 1 week
2011-05-23 20:59:50 +00:00
Pawel Jakub Dawidek
aa27d9ef94
Recognize HIO_FLUSH requests.
...
MFC after: 1 week
2011-05-21 20:21:20 +00:00
Pawel Jakub Dawidek
588e8623d0
Document IPv6 support.
...
MFC after: 3 weeks
2011-05-20 11:21:39 +00:00
Pawel Jakub Dawidek
89bad89a59
If no listen address is specified, bind by default to:
...
tcp4://0.0.0.0:8457
tcp6://[::]:8457
MFC after: 3 weeks
2011-05-20 11:16:25 +00:00
Pawel Jakub Dawidek
a87399ba7f
Rename ipv4/ipv6 to tcp4/tcp6.
...
MFC after: 3 weeks
2011-05-20 11:15:27 +00:00
Pawel Jakub Dawidek
dc18c8ae6c
Now that hell is fully frozen it is good time to add IPv6 support to HAST.
...
MFC after: 3 weeks
2011-05-20 11:14:05 +00:00
Pawel Jakub Dawidek
496a87aa30
Allow [ ] characters in strings. They might be used in IPv6 addresses.
...
MFC after: 3 weeks
2011-05-20 11:10:39 +00:00
Pawel Jakub Dawidek
bdbd046b35
Rename tcp4 to tcp in preparation for IPv6 support.
...
MFC after: 3 weeks
2011-05-20 11:09:02 +00:00
Pawel Jakub Dawidek
933728eea2
Rename proto_tcp4.c to proto_tcp.c in preparation for IPv6 support.
...
MFC after: 2 weeks
2011-05-20 11:06:17 +00:00