summaryrefslogtreecommitdiffstats
path: root/sbin/hastd/hastd.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-09-28 13:08:51 +0000
committerpjd <pjd@FreeBSD.org>2011-09-28 13:08:51 +0000
commit374501b4952a809fac64c99d244ca1236ae5d5ca (patch)
tree6a9d1cc1d75b048ee6b4589e34493d484a6f71ab /sbin/hastd/hastd.c
parent444642eb38a412e2dc6dc790a370f2c6ea209ebf (diff)
downloadFreeBSD-src-374501b4952a809fac64c99d244ca1236ae5d5ca.zip
FreeBSD-src-374501b4952a809fac64c99d244ca1236ae5d5ca.tar.gz
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
Diffstat (limited to 'sbin/hastd/hastd.c')
-rw-r--r--sbin/hastd/hastd.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/sbin/hastd/hastd.c b/sbin/hastd/hastd.c
index 6518f0c..d21f7f6 100644
--- a/sbin/hastd/hastd.c
+++ b/sbin/hastd/hastd.c
@@ -386,6 +386,12 @@ resource_needs_restart(const struct hast_resource *res0,
return (true);
if (strcmp(res0->hr_exec, res1->hr_exec) != 0)
return (true);
+ /*
+ * When metaflush has changed we don't really need restart,
+ * but it is just easier this way.
+ */
+ if (res0->hr_metaflush != res1->hr_metaflush)
+ return (true);
}
return (false);
}
@@ -416,6 +422,8 @@ resource_needs_reload(const struct hast_resource *res0,
return (true);
if (strcmp(res0->hr_exec, res1->hr_exec) != 0)
return (true);
+ if (res0->hr_metaflush != res1->hr_metaflush)
+ return (true);
return (false);
}
@@ -436,6 +444,7 @@ resource_reload(const struct hast_resource *res)
nv_add_int32(nvout, (int32_t)res->hr_compression, "compression");
nv_add_int32(nvout, (int32_t)res->hr_timeout, "timeout");
nv_add_string(nvout, res->hr_exec, "exec");
+ nv_add_int32(nvout, (int32_t)res->hr_metaflush, "metaflush");
if (nv_error(nvout) != 0) {
nv_free(nvout);
pjdlog_error("Unable to allocate header for reload message.");
@@ -591,12 +600,13 @@ hastd_reload(void)
* recreating it.
*
* We do just reload (send SIGHUP to worker process) if we act as
- * PRIMARY, but only if remote address, replication mode, timeout or
- * execution path has changed. For those, there is no need to restart
- * worker process.
+ * PRIMARY, but only if remote address, source address, replication
+ * mode, timeout, execution path or metaflush has changed.
+ * For those, there is no need to restart worker process.
* If PRIMARY receives SIGHUP, it will reconnect if remote address or
- * replication mode has changed or simply set new timeout if only
- * timeout has changed.
+ * source address has changed or it will set new timeout if only timeout
+ * has changed or it will update metaflush if only metaflush has
+ * changed.
*/
TAILQ_FOREACH_SAFE(nres, &newcfg->hc_resources, hr_next, tres) {
TAILQ_FOREACH(cres, &cfg->hc_resources, hr_next) {
@@ -627,6 +637,7 @@ hastd_reload(void)
cres->hr_timeout = nres->hr_timeout;
strlcpy(cres->hr_exec, nres->hr_exec,
sizeof(cres->hr_exec));
+ cres->hr_metaflush = nres->hr_metaflush;
if (cres->hr_workerpid != 0)
resource_reload(cres);
}
OpenPOWER on IntegriCloud