summaryrefslogtreecommitdiffstats
path: root/sbin/hastctl
Commit message (Collapse)AuthorAgeFilesLines
* MFC r257155, r257582, r259191, r259192, r259193, r259194, r259195, r259196:trociny2013-12-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r257155: Make hastctl list command output current queue sizes. Reviewed by: pjd r257582 (pjd): Correct alignment. r259191: For memsync replication, hio_countdown is used not only as an indication when a request can be moved to done queue, but also for detecting the current state of memsync request. This approach has problems, e.g. leaking a request if memsynk ack from the secondary failed, or racy usage of write_complete, which should be called only once per write request, but for memsync can be entered by local_send_thread and ggate_send_thread simultaneously. So the following approach is implemented instead: 1) Use hio_countdown only for counting components we waiting to complete, i.e. initially it is always 2 for any replication mode. 2) To distinguish between "memsync ack" and "memsync fin" responses from the secondary, add and use hio_memsyncacked field. 3) write_complete() in component threads is called only before releasing hio_countdown (i.e. before the hio may be returned to the done queue). 4) Add and use hio_writecount refcounter to detect when write_complete() can be called in memsync case. Reported by: Pete French petefrench ingresso.co.uk Tested by: Pete French petefrench ingresso.co.uk r259192: Add some macros to make the code more readable (no functional chages). r259193: Fix compiler warnings. r259194: In remote_send_thread, if sending a request fails don't take the request back from the receive queue -- it might already be processed by remote_recv_thread, which lead to crashes like below: (primary) Unable to receive reply header: Connection reset by peer. (primary) Unable to send request (Connection reset by peer): WRITE(954662912, 131072). (primary) Disconnected from kopusha:7772. (primary) Increasing localcnt to 1. (primary) Assertion failed: (old > 0), function refcnt_release, file refcnt.h, line 62. Taking the request back was not necessary (it would properly be processed by the remote_recv_thread) and only complicated things. r259195: Send wakeup to threads waiting on empty queue before releasing the lock to decrease spurious wakeups. Submitted by: davidxu r259196: Check remote protocol version only for the first connection (when it is actually sent by the remote node). Otherwise it generated confusing "Negotiated protocol version 1" debug messages when processing the second connection.
* Make hastctl(1) ('list' command) output a worker pid.trociny2013-07-011-0/+4
| | | | | Reviewed by: pjd MFC after: 3 days
* Get rid of libl dependency. We needed it only to provide yywrap. Buttrociny2013-05-111-2/+2
| | | | | | | yywrap is not necessary when parsing a single hast.conf file. Suggested by: kib Reviewed by: pjd
* Remove code duplication.trociny2013-04-211-11/+1
|
* Add the Clang specific -Wmissing-variable-declarations to WARNS=6.ed2013-04-191-0/+1
| | | | | | | | | | | | | This compiler flag enforces that that people either mark variables static or use an external declarations for the variable, similar to how -Wmissing-prototypes works for functions. Due to the fact that Yacc/Lex generate code that cannot trivially be changed to not warn because of this (lots of yy* variables), add a NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this specific compiler warning. Announced on: toolchain@
* Rename 'status' command to 'list' and introduce new 'status' which producesmarck2013-03-142-5/+71
| | | | | | | | | | more terse output more observable for both scripts and humans. Also, it shifts hastctl closer to GEOM utilities with their list/status command pairs. Approved by: pjd MFC after: 4 weeks
* Removed redundant includes.pjd2013-03-141-10/+0
|
* Fix casting.trociny2013-02-261-5/+5
| | | | MFC after: 3 days
* Add i/o error counters to hastd(8) and make hastctl(8) displaytrociny2013-02-251-0/+6
| | | | | | | them. This may be useful for detecting problems with HAST disks. Discussed with and reviewed by: pjd MFC after: 1 week
* Fixes to man8 groff mandoc style, usage mistakes, or typos.wblock2012-05-241-1/+1
| | | | | | | PR: 168016 Submitted by: Nobuyuki Koganemaru Approved by: gjb MFC after: 3 days
* For functions that return -1 on failure check exactly for -1 and not forpjd2012-01-101-9/+9
| | | | | | any negative number. MFC after: 3 days
* Spelling fixes for sbin/uqs2012-01-071-1/+1
|
* Use NO_WCAST_ALIGN for usr.bin/hastctl and usr.bin/hastd; the alignmentdim2011-12-191-0/+1
| | | | | | | warnings in sbin/hastd/lzf.c are only emitted for i386 and amd64, and there they can be safely ignored. MFC after: 1 week
* Revert r226726. The line was not duplicated.pjd2011-10-251-0/+1
| | | | | Spotted by: pluknet MFC after: 3 days
* Remove duplicated line.pjd2011-10-251-1/+0
| | | | MFC after: 3 days
* Prefer PJDLOG_ASSERT()/PJDLOG_ABORT() over assert().pjd2011-09-271-6/+5
| | | | MFC after: 3 days
* When exiting with error because of an invalid command line argumenttrociny2011-07-131-3/+3
| | | | | | use errx(3), not err(3), and the exit code from sysexits(3). Approved by: pjd (mentor)
* Compile hastd and hastctl with capsicum support.pjd2011-06-271-0/+1
| | | | X-MFC after: capsicum merge
* Keep statistics on number of BIO_READ, BIO_WRITE, BIO_DELETE and BIO_FLUSHpjd2011-05-231-0/+11
| | | | | | | | | | | 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
* Currently we are unable to use capsicum for the primary worker process,pjd2011-05-141-1/+1
| | | | | | | | | | | | | | | | | because we need to do ioctl(2)s, which are not permitted in the capability mode. What we do now is to chroot(2) to /var/empty, which restricts access to file system name space and we drop privileges to hast user and hast group. This still allows to access to other name spaces, like list of processes, network and sysvipc. To address that, use jail(2) instead of chroot(2). Using jail(2) will restrict access to process table, network (we use ip-less jails) and sysvipc (if security.jail.sysvipc_allowed is turned off). This provides much better separation. MFC after: 1 week
* Fix assert messages.trociny2011-04-261-2/+2
| | | | Approved by: pjd (mentor)
* Remove hast_proto_recv(). It was used only in one place, wheretrociny2011-04-171-1/+1
| | | | | | | | hast_proto_recv_hdr() may be used. This also fixes the issue (introduced by r220523) with hastctl, which crashed on assert in hast_proto_recv_data(). Suggested and approved by: pjd (mentor)
* hastd(8) maintains a map of dirty extents, not hastctl(8). Fix this.trociny2011-04-101-2/+2
| | | | | Approved by: pjd (mentor) MFC after: 3 days
* Forgot to commit this as part of r219873.pjd2011-03-221-1/+1
| | | | MFC after: 1 week
* When dropping privileges prefer capsicum over chroot+setgid+setuid.pjd2011-03-211-2/+1
| | | | | | | | | We can use capsicum for secondary worker processes and hastctl. When working as primary we drop privileges using chroot+setgid+setuid still as we need to send ioctl(2)s to ggate device, for which capsicum doesn't allow (yet). X-MFC after: capsicum is merged to stable/8
* Forgot to commit this as a part of r219818.pjd2011-03-211-1/+4
| | | | MFC after: 1 week
* In command line options allow size to be specified using k/M/G/Ttrociny2011-03-132-25/+9
| | | | | | | suffixes. Approved by: pjd (mentor) MFC after: 1 week
* Print some of the numbers in human readable form (using %N).pjd2011-03-071-6/+10
| | | | MFC after: 2 weeks
* - Turn on printf extentions.pjd2011-03-071-2/+3
| | | | | | | | | | - Load support for %T for pritning time. - Add support for %N for printing number in human readable form. - Add support for %S for printing sockaddr structure (currently only AF_INET family is supported, as this is all we need in HAST). - Disable gcc compile-time format checking as this will no longer work. MFC after: 2 weeks
* Allow to compress on-the-wire data using two algorithms:pjd2011-03-061-1/+2
| | | | | | | | | | | - HOLE - it simply turns all-zero blocks into few bytes header; it is extremely fast, so it is turned on by default; it is mostly intended to speed up initial synchronization where we expect many zeros; - LZF - very fast algorithm by Marc Alexander Lehmann, which shows very decent compression ratio and has BSD license. MFC after: 2 weeks
* Allow to checksum on-the-wire data using either CRC32 or SHA256.pjd2011-03-061-1/+2
| | | | MFC after: 2 weeks
* Drop privileges after connecting to hastd, but before sending or receivingpjd2011-02-031-0/+5
| | | | | | anything. MFC after: 1 week
* Add missing argument after r218192.bz2011-02-021-1/+1
|
* Add functions to initialize/finalize pjdlog. This allows to open/close logpjd2011-01-271-0/+1
| | | | | | file at will. MFC after: 1 week
* Fix some more warnings found by clang.brucec2010-11-221-0/+1
|
* Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki whilejoel2010-08-161-1/+1
| | | | | | translating these manual pages. Minor corrections by me. Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
* Update the arguments to yy_config_parse() to match r210883.dougb2010-08-061-1/+1
| | | | | Choose the more conservative option ('yes' to exit on error) to match the equivalent code in hastd.
* Fix typo.pjd2010-07-291-1/+1
| | | | | | PR: docs/149033 Submitted by: Kolar <hsn@sendmail.cz> MFC after: 3 days
* mdoc: move remaining sections into consistent orderuqs2010-05-131-14/+14
| | | | | | | This pertains mostly to FILES, HISTORY, EXIT STATUS and AUTHORS sections. Found by: mdocml lint run Reviewed by: ru
* Fix compilation with WITHOUT_CRYPT or WITHOUT_OPENSSL options.pjd2010-04-221-2/+7
| | | | | Reported by: Andrei V. Lavreniyuk <andy.lavr@reactor-xg.kiev.ua> MFC after: 3 days
* Remove redundant WARNS?=6 overrides and inherit the WARNS setting fromuqs2010-03-021-1/+0
| | | | | | | | the toplevel directory. This does not change any WARNS level and survives a make universe. Approved by: ed (co-mentor)
* Please welcome HAST - Highly Avalable Storage.pjd2010-02-183-0/+779
HAST allows to transparently store data on two physically separated machines connected over the TCP/IP network. HAST works in Primary-Secondary (Master-Backup, Master-Slave) configuration, which means that only one of the cluster nodes can be active at any given time. Only Primary node is able to handle I/O requests to HAST-managed devices. Currently HAST is limited to two cluster nodes in total. HAST operates on block level - it provides disk-like devices in /dev/hast/ directory for use by file systems and/or applications. Working on block level makes it transparent for file systems and applications. There in no difference between using HAST-provided device and raw disk, partition, etc. All of them are just regular GEOM providers in FreeBSD. For more information please consult hastd(8), hastctl(8) and hast.conf(5) manual pages, as well as http://wiki.FreeBSD.org/HAST. Sponsored by: FreeBSD Foundation Sponsored by: OMCnet Internet Service GmbH Sponsored by: TransIP BV
OpenPOWER on IntegriCloud