Whamcloud - gitweb
b=2525
authorrread <rread>
Thu, 22 Jul 2004 16:30:26 +0000 (16:30 +0000)
committerrread <rread>
Thu, 22 Jul 2004 16:30:26 +0000 (16:30 +0000)
I've seen the "server went back in time" message while testing HEAD,
so this will fix that.  Patch already on 1.4.

lustre/mds/mds_fs.c
lustre/obdfilter/filter.c
lustre/tests/replay-single.sh

index e32ba3f..38654a5 100644 (file)
@@ -167,6 +167,12 @@ int mds_client_free(struct obd_export *exp, int clear_client)
                 LBUG();
         }
 
+
+        /* Make sure the server's last_transno is up to date. Do this
+         * after the client is freed so we know all the client's
+         * transactions have been committed. */
+        mds_update_server_data(exp->exp_obd, 1);
+
  free_and_out:
         OBD_FREE(med->med_mcd, sizeof(*med->med_mcd));
 
index 8fe771e..b464c7b 100644 (file)
@@ -263,6 +263,10 @@ static int filter_client_free(struct obd_export *exp, int flags)
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         rc = fsfilt_write_record(obd, filter->fo_rcvd_filp, &zero_fcd,
                                  sizeof(zero_fcd), &off, 1);
+        if (rc == 0)
+                /* update server's transno */
+                filter_update_server_data(obd, filter->fo_rcvd_filp,
+                                          filter->fo_fsd, 1);
         pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
 
         CDEBUG(rc == 0 ? D_INFO : D_ERROR,
index 2a6cddb..271b242 100755 (executable)
@@ -956,6 +956,27 @@ test_47() {
 }
 run_test 47 "MDS->OSC failure during precreate cleanup (2824)"
 
+
+test_48() {
+    createmany -o $DIR/${tfile}- 100
+    $CHECKSTAT $DIR/${tfile}-99 || return 1
+    mds_evict_client
+    df $MOUNT || df $MOUNT || return 2
+    sleep 1
+    $CHECKSTAT $DIR/${tfile}-99 || return 3
+
+    dmesg -c >/dev/null
+    replay_barrier mds1
+    fail mds1
+    unlinkmany $DIR/${tfile}- 100 || return 4
+    if dmesg | grep "back in time"; then 
+       echo "server went back in time!"
+       return 5
+    fi
+    return 0
+}
+run_test 48 "Don't lose transno when client is evicted (2525)"
+
 equals_msg test complete, cleaning up
 $CLEANUP