#define OBD_FAIL_FORCE_GC_THREAD 0x1316
#define OBD_FAIL_LLOG_PROCESS_TIMEOUT 0x1317
#define OBD_FAIL_LLOG_PURGE_DELAY 0x1318
+#define OBD_FAIL_PLAIN_RECORDS 0x1319
+#define OBD_FAIL_CATALOG_FULL_CHECK 0x131a
#define OBD_FAIL_LLITE 0x1400
#define OBD_FAIL_LLITE_FAULT_TRUNC_RACE 0x1401
struct llog_handle *loghandle,
llog_cb_t cb, void *data, void *catdata, bool fork)
{
- struct llog_process_info *lpi;
- int rc;
+ struct llog_process_info *lpi;
+ struct llog_process_data *d = data;
+ struct llog_process_cat_data *cd = catdata;
+ int rc;
- ENTRY;
+ ENTRY;
OBD_ALLOC_PTR(lpi);
if (lpi == NULL) {
lpi->lpi_cbdata = data;
lpi->lpi_catdata = catdata;
+ CDEBUG(D_OTHER, "Processing "DFID" flags 0x%03x startcat %d startidx %d first_idx %d last_idx %d\n",
+ PFID(&loghandle->lgh_id.lgl_oi.oi_fid),
+ loghandle->lgh_hdr->llh_flags, d ? d->lpd_startcat : -1,
+ d ? d->lpd_startidx : -1, cd ? cd->lpcd_first_idx : -1,
+ cd ? cd->lpcd_last_idx : -1);
if (fork) {
struct task_struct *task;
if (freespace > (128 << 20))
loghandle->lgh_max_size = 128 << 20;
}
+ if (unlikely(OBD_FAIL_PRECHECK(OBD_FAIL_PLAIN_RECORDS) ||
+ OBD_FAIL_PRECHECK(OBD_FAIL_CATALOG_FULL_CHECK))) {
+ // limit the numer of plain records for test
+ loghandle->lgh_max_size = loghandle->lgh_hdr_size +
+ cfs_fail_val * 64;
+ }
+
rc = 0;
out:
* catalog bottom.
*/
startcat = 0;
+ d.lpd_startcat = 0;
if (rc != 0)
RETURN(rc);
}
#define DEBUG_SUBSYSTEM S_MDS
#include <linux/kthread.h>
+#include <linux/delay.h>
#include <lustre_log.h>
#include <lustre_update.h>
#include "osp_internal.h"
llh = NULL;
rec = NULL;
}
+ if (OBD_FAIL_PRECHECK(OBD_FAIL_CATALOG_FULL_CHECK) &&
+ cfs_fail_val != 1)
+ msleep(1 * MSEC_PER_SEC);
wait_event_idle(d->opd_sync_waitq,
!osp_sync_running(d) ||
/* processing reaches catalog bottom */
if (d->opd_sync_last_catalog_idx == size)
d->opd_sync_last_catalog_idx = LLOG_CAT_FIRST;
- else if (wrapped)
- /* If catalog is wrapped we can`t predict last index of
- * processing because lgh_last_idx could be changed.
- * Starting form the next one */
- d->opd_sync_last_catalog_idx++;
-
+ /* If catalog is wrapped we can`t predict last index of
+ * processing because lgh_last_idx could be changed.
+ * Starting form the next one. Index would be increased
+ * at llog_process_thread
+ */
} while (rc == 0 && (wrapped ||
d->opd_sync_last_catalog_idx == LLOG_CAT_FIRST));
fi
# 5 12 (min)"
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="27m 64b 68 71 115 300o"
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="27m 64b 68 71 115 135 136 300o"
if [ "$mds1_FSTYPE" = "zfs" ]; then
# bug number for skipped test:
}
run_test 134b "Server rejects lock request when reaching lock_limit_mb"
+test_135() {
+ remote_mds_nodsh && skip "remote MDS with nodsh"
+ [[ $MDS1_VERSION -lt $(version_code 2.13.50) ]] &&
+ skip "Need MDS version at least 2.13.50"
+ local fname
+
+ mkdir -p $DIR/$tdir || error "failed to create $DIR/$tdir"
+
+#define OBD_FAIL_PLAIN_RECORDS 0x1319
+ #set only one record at plain llog
+ do_facet $SINGLEMDS $LCTL set_param fail_loc=0x1319 fail_val=1
+
+ #fill already existed plain llog each 64767
+ #wrapping whole catalog
+ createmany -o -u $DIR/$tdir/$tfile- $((64767 * 1))
+
+ createmany -o $DIR/$tdir/$tfile_ 64700
+ for (( i = 0; i < 64700; i = i + 2 ))
+ do
+ rm $DIR/$tdir/$tfile_$i &
+ rm $DIR/$tdir/$tfile_$((i + 1)) &
+ local pid=$!
+ wait $pid
+ done
+
+ #waiting osp synchronization
+ wait_delete_completed
+}
+run_test 135 "Race catalog processing"
+
+test_136() {
+ remote_mds_nodsh && skip "remote MDS with nodsh"
+ [[ $MDS1_VERSION -lt $(version_code 2.13.50) ]] &&
+ skip "Need MDS version at least 2.13.50"
+ local fname
+
+ mkdir -p $DIR/$tdir || error "failed to create $DIR/$tdir"
+ $SETSTRIPE -c 1 -i 0 $DIR/$tdir || error "failed to set striping"
+ #set only one record at plain llog
+#define OBD_FAIL_CATALOG_FULL_CHECK 0x131a
+ do_facet $SINGLEMDS $LCTL set_param fail_loc=0x131a fail_val=1
+
+ #fill already existed 2 plain llogs each 64767
+ #wrapping whole catalog
+ createmany -o -u $DIR/$tdir/$tfile- $((64767 * 1))
+ createmany -o -u $DIR/$tdir/$tfile- $((64767 * 3 / 2))
+ wait_delete_completed
+
+ createmany -o $DIR/$tdir/$tfile_ 10
+ sleep 25
+
+ do_facet $SINGLEMDS $LCTL set_param fail_val=3
+ for (( i = 0; i < 10; i = i + 3 ))
+ do
+ rm $DIR/$tdir/$tfile_$i &
+ rm $DIR/$tdir/$tfile_$((i + 1)) &
+ local pid=$!
+ wait $pid
+ sleep 7
+ rm $DIR/$tdir/$tfile_$((i + 2)) &
+ done
+
+ #waiting osp synchronization
+ wait_delete_completed
+}
+run_test 136 "Race catalog processing 2"
+
test_140() { #bug-17379
[ $PARALLEL == "yes" ] && skip "skip parallel run"