The mgc_process_cfg_log() fails if 'params' log is not
accessinble and has no local copy. In fact that log is
optional and may be just empty.
Patch allows 'params' log to be empty and checks also for
'params' log in other places to avoid wrong error messages.
There was also deprecated code in mgs_write_log_direct_all()
which creates lustre-params log which is not used by anyone now.
Third change is removal of exceptions in conf-sanity.sh and
insanity.sh related to LU-2059
The only exception is insanity test_1 which is still failed due
to other reason.
This patch is back-ported from the following one:
Lustre-commit:
864fc9daac267819f5e3bdebef6cdac4c6325626
Lustre-change: http://review.whamcloud.com/10311
Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: I081ca3920f3c2d05d4e966ed5234369ddc0eaac0
Reviewed-on: http://review.whamcloud.com/12427
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
rc = mgc_llog_local_copy(env, mgc, ctxt, lctxt,
cld->cld_logname);
if (local_only || rc) {
- if (llog_is_empty(env, lctxt, cld->cld_logname)) {
+ if (strcmp(cld->cld_logname, PARAMS_FILENAME) != 0 &&
+ llog_is_empty(env, lctxt, cld->cld_logname)) {
LCONSOLE_ERROR_MSG(0x13a, "Failed to get MGS "
"log %s and no local copy."
"\n", cld->cld_logname);
CDEBUG(D_MGC, "Failed to get MGS log %s, using local "
"copy for now, will try to update later.\n",
cld->cld_logname);
+ rc = 0;
}
/* Now, whether we copied or not, start using the local llog.
* If we failed to copy, we'll start using whatever the old
char *ptr = strchr(logname, '-');
int len = (int)(ptr - logname);
- if (ptr == NULL || len >= sizeof(mgi->mgi_fsname)) {
+ if ((ptr == NULL && strcmp(logname, PARAMS_FILENAME) != 0) ||
+ len >= sizeof(mgi->mgi_fsname)) {
LCONSOLE_WARN("%s: non-config logname received: %s\n",
tgt_name(tsi->tsi_tgt), logname);
/* not error, this can be llog test name */
cfs_list_t list;
struct mgs_direntry *dirent, *n;
char *fsname = mti->mti_fsname;
- char *logname;
int rc = 0, len = strlen(fsname);
ENTRY;
- /* We need to set params for any future logs
- as well. FIXME Append this file to every new log.
- Actually, we should store as params (text), not llogs. Or
- in a database. */
- rc = name_create(&logname, fsname, "-params");
- if (rc)
- RETURN(rc);
- if (mgs_log_is_empty(env, mgs, logname)) {
- struct llog_handle *llh = NULL;
- rc = record_start_log(env, mgs, &llh, logname);
- record_end_log(env, &llh);
- }
- name_destroy(&logname);
- if (rc)
- RETURN(rc);
-
/* Find all the logs in the CONFIGS directory */
rc = class_dentry_readdir(env, mgs, &list);
if (rc)
}
EXPORT_SYMBOL(llog_close);
+/**
+ * Helper function to get the llog size in records. It is used by MGS
+ * mostly to check that config llog exists and contains data.
+ *
+ * \param[in] env execution environment
+ * \param[in] ctxt llog context
+ * \param[in] name llog name
+ *
+ * \retval true if there are records in llog besides a header
+ * \retval false on error or llog without records
+ */
int llog_is_empty(const struct lu_env *env, struct llog_ctxt *ctxt,
char *name)
{
out_close:
llog_close(env, llh);
out:
- /* header is record 1 */
+ /* The header is record 1, the llog is still considered as empty
+ * if there is only header */
return (rc <= 1);
}
EXPORT_SYMBOL(llog_is_empty);
fi
[ $(facet_fstype $SINGLEMDS) = "zfs" ] &&
-# bug number for skipped test: LU-2778 LU-2059 LU-4444
- ALWAYS_EXCEPT="$ALWAYS_EXCEPT 57b 50h 69"
+# bug number for skipped test: LU-2778 LU-4444
+ ALWAYS_EXCEPT="$ALWAYS_EXCEPT 57b 69"
init_logging
grep " $MOUNT " /etc/mtab && \
error false "unexpected entry in mtab before mount" && return 10
- [ "$(facet_fstype ost1)" = "zfs" ] &&
- skip "LU-2059: no local config for ZFS OSTs" && return
-
local rc=0
start_ost
start_mds
run_test 19a "start/stop MDS without OSTs"
test_19b() {
- [ "$(facet_fstype ost1)" = "zfs" ] &&
- skip "LU-2059: no local config for ZFS OSTs" && return
-
start_ost || return 1
stop_ost -f || return 2
}
run_test 21a "start mds before ost, stop ost first"
test_21b() {
- [ "$(facet_fstype ost1)" = "zfs" ] &&
- skip "LU-2059: no local config for ZFS OSTs" && return
-
start_ost
start_mds
wait_osc_import_state mds ost FULL
run_test 26 "MDT startup failure cleans LOV (should return errs)"
test_27a() {
- [ "$(facet_fstype ost1)" = "zfs" ] &&
- skip "LU-2059: no local config for ZFS OSTs" && return
-
start_ost || return 1
start_mds || return 2
echo "Requeue thread should have started: "
test_50h() {
# prepare MDT/OST, make OSC inactive for OST1
[ "$OSTCOUNT" -lt "2" ] && skip_env "$OSTCOUNT < 2, skipping" && return
+
+ [ $(facet_fstype ost1) == zfs ] && import_zpool ost1
do_facet ost1 "$TUNEFS --param osc.active=0 `ostdevname 1`" ||
error "tunefs OST1 failed"
start_mds || error "Unable to start MDT"
echo "Verify Lustre filesystem is up and running"
[ -z "$(mounted_lustre_filesystems)" ] && error "Lustre is not running"
- [ "$(facet_fstype ost1)" = "zfs" ] &&
- skip "LU-2059: no local config for ZFS OSTs" && return
-
- clients_up
+ clients_up
for i in $(seq $MDSCOUNT) ; do
shutdown_facet mds$i
test_4() {
echo "Fourth Failure Mode: OST/MDS `date`"
- [ "$(facet_fstype ost1)" = "zfs" ] &&
- skip "LU-2059: no local config for ZFS OSTs" && return
-
#OST Portion
shutdown_facet ost1