Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qa: misc cephfs test improvements #15411

Merged
merged 5 commits into from Jun 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Empty file removed qa/suites/fs/standbyreplay/%
Empty file.
1 change: 0 additions & 1 deletion qa/suites/fs/standbyreplay/begin.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions qa/suites/fs/standbyreplay/clusters/standby-replay.yaml

This file was deleted.

1 change: 0 additions & 1 deletion qa/suites/fs/standbyreplay/mount/fuse.yaml

This file was deleted.

1 change: 0 additions & 1 deletion qa/suites/fs/standbyreplay/objectstore

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion qa/suites/fs/standbyreplay/overrides/debug.yaml

This file was deleted.

1 change: 0 additions & 1 deletion qa/suites/fs/standbyreplay/overrides/frag_enable.yaml

This file was deleted.

This file was deleted.

8 changes: 8 additions & 0 deletions qa/suites/multimds/basic/q_check_counter/check_counter.yaml
@@ -0,0 +1,8 @@

tasks:
- check-counter:
counters:
mds:
- "mds.exported"
- "mds.imported"

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

26 changes: 14 additions & 12 deletions qa/tasks/cephfs/test_exports.py
Expand Up @@ -6,6 +6,8 @@
log = logging.getLogger(__name__)

class TestExports(CephFSTestCase):
MDSS_REQUIRED = 2

def _wait_subtrees(self, status, rank, test):
timeout = 30
pause = 2
Expand All @@ -30,15 +32,15 @@ def test_export_pin(self):
self._wait_subtrees(status, 0, [])

# NOP
self.mount_a.run_shell(["setfattr", "-n", "ceph.dir.pin", "-v", "-1", "1"])
self.mount_a.setfattr("1", "ceph.dir.pin", "-1")
self._wait_subtrees(status, 0, [])

# NOP (rank < -1)
self.mount_a.run_shell(["setfattr", "-n", "ceph.dir.pin", "-v", "-2341", "1"])
self.mount_a.setfattr("1", "ceph.dir.pin", "-2341")
self._wait_subtrees(status, 0, [])

# pin /1 to rank 1
self.mount_a.run_shell(["setfattr", "-n", "ceph.dir.pin", "-v", "1", "1"])
self.mount_a.setfattr("1", "ceph.dir.pin", "1")
self._wait_subtrees(status, 1, [('/1', 1)])

# Check export_targets is set properly
Expand All @@ -48,34 +50,34 @@ def test_export_pin(self):
self.assertTrue(sorted(r0['export_targets']) == [1])

# redundant pin /1/2 to rank 1
self.mount_a.run_shell(["setfattr", "-n", "ceph.dir.pin", "-v", "1", "1/2"])
self.mount_a.setfattr("1/2", "ceph.dir.pin", "1")
self._wait_subtrees(status, 1, [('/1', 1), ('/1/2', 1)])

# change pin /1/2 to rank 0
self.mount_a.run_shell(["setfattr", "-n", "ceph.dir.pin", "-v", "0", "1/2"])
self.mount_a.setfattr("1/2", "ceph.dir.pin", "0")
self._wait_subtrees(status, 1, [('/1', 1), ('/1/2', 0)])
self._wait_subtrees(status, 0, [('/1', 1), ('/1/2', 0)])

# change pin /1/2/3 to (presently) non-existent rank 2
self.mount_a.run_shell(["setfattr", "-n", "ceph.dir.pin", "-v", "2", "1/2/3"])
self.mount_a.setfattr("1/2/3", "ceph.dir.pin", "2")
self._wait_subtrees(status, 0, [('/1', 1), ('/1/2', 0)])
self._wait_subtrees(status, 1, [('/1', 1), ('/1/2', 0)])

# change pin /1/2 back to rank 1
self.mount_a.run_shell(["setfattr", "-n", "ceph.dir.pin", "-v", "1", "1/2"])
self.mount_a.setfattr("1/2", "ceph.dir.pin", "1")
self._wait_subtrees(status, 1, [('/1', 1), ('/1/2', 1)])

# add another directory pinned to 1
self.mount_a.run_shell(["mkdir", "-p", "1/4/5"])
self.mount_a.run_shell(["setfattr", "-n", "ceph.dir.pin", "-v", "1", "1/4/5"])
self.mount_a.setfattr("1/4/5", "ceph.dir.pin", "1")
self._wait_subtrees(status, 1, [('/1', 1), ('/1/2', 1), ('/1/4/5', 1)])

# change pin /1 to 0
self.mount_a.run_shell(["setfattr", "-n", "ceph.dir.pin", "-v", "0", "1"])
self.mount_a.setfattr("1", "ceph.dir.pin", "0")
self._wait_subtrees(status, 0, [('/1', 0), ('/1/2', 1), ('/1/4/5', 1)])

# change pin /1/2 to default (-1); does the subtree root properly respect it's parent pin?
self.mount_a.run_shell(["setfattr", "-n", "ceph.dir.pin", "-v", "-1", "1/2"])
self.mount_a.setfattr("1/2", "ceph.dir.pin", "-1")
self._wait_subtrees(status, 0, [('/1', 0), ('/1/4/5', 1)])

if len(list(status.get_standbys())):
Expand All @@ -95,8 +97,8 @@ def test_export_pin(self):

# Test rename
self.mount_a.run_shell(["mkdir", "-p", "a/b", "aa/bb"])
self.mount_a.run_shell(["setfattr", "-n", "ceph.dir.pin", "-v", "1", "a"])
self.mount_a.run_shell(["setfattr", "-n", "ceph.dir.pin", "-v", "0", "aa/bb"])
self.mount_a.setfattr("a", "ceph.dir.pin", "1")
self.mount_a.setfattr("aa/bb", "ceph.dir.pin", "0")
self._wait_subtrees(status, 0, [('/1', 0), ('/1/4/5', 1), ('/1/2/3', 2), ('/a', 1), ('/aa/bb', 0)])
self.mount_a.run_shell(["mv", "aa", "a/b/"])
self._wait_subtrees(status, 0, [('/1', 0), ('/1/4/5', 1), ('/1/2/3', 2), ('/a', 1), ('/a/b/aa/bb', 0)])
41 changes: 35 additions & 6 deletions qa/tasks/cephfs/test_journal_migration.py
Expand Up @@ -9,19 +9,41 @@

class TestJournalMigration(CephFSTestCase):
CLIENTS_REQUIRED = 1
MDSS_REQUIRED = 2

def test_journal_migration(self):
old_journal_version = JOURNAL_FORMAT_LEGACY
new_journal_version = JOURNAL_FORMAT_RESILIENT

self.fs.set_ceph_conf('mds', 'mds journal format', old_journal_version)
# Pick out two daemons to use
mds_a, mds_b = sorted(self.mds_cluster.mds_ids[0:2])

# Create a filesystem using the older journal format.
self.mount_a.umount_wait()
self.fs.mds_stop()

# Enable standby replay, to cover the bug case #8811 where
# a standby replay might mistakenly end up trying to rewrite
# the journal at the same time as an active daemon.
self.fs.set_ceph_conf('mds', 'mds standby replay', "true")
self.fs.set_ceph_conf('mds', 'mds standby for rank', "0")

# Create a filesystem using the older journal format.
self.fs.set_ceph_conf('mds', 'mds journal format', old_journal_version)
self.fs.recreate()
self.fs.mds_restart()
self.fs.mds_restart(mds_id=mds_a)
self.fs.wait_for_daemons()
self.assertEqual(self.fs.get_active_names(), [mds_a])

def replay_names():
return [s['name']
for s in self.fs.status().get_replays(fscid = self.fs.id)]

# Start the standby and wait for it to come up
self.fs.mds_restart(mds_id=mds_b)
self.wait_until_equal(
replay_names,
[mds_b],
timeout = 30)

# Do some client work so that the log is populated with something.
with self.mount_a.mounted():
Expand All @@ -41,8 +63,8 @@ def test_journal_migration(self):
self.fs.set_ceph_conf('mds', 'mds journal format', new_journal_version)

# Restart the MDS.
self.fs.mds_fail_restart()
self.fs.wait_for_daemons()
self.fs.mds_fail_restart(mds_id=mds_a)
self.fs.mds_fail_restart(mds_id=mds_b)

# This ensures that all daemons come up into a valid state
self.fs.wait_for_daemons()
Expand Down Expand Up @@ -79,11 +101,18 @@ def test_journal_migration(self):
# Approximate value of "lots", expected from having run fsstress
raise RuntimeError("Unexpectedly few journal events: {0}".format(event_count))

# Do some client work so that the log is populated with something.
# Do some client work to check that writing the log is still working
with self.mount_a.mounted():
workunit(self.ctx, {
'clients': {
"client.{0}".format(self.mount_a.client_id): ["fs/misc/trivial_sync.sh"],
},
"timeout": "3h"
})

# Check that both an active and a standby replay are still up
self.assertEqual(len(replay_names()), 1)
self.assertEqual(len(self.fs.get_active_names()), 1)
self.assertTrue(self.mds_cluster.mds_daemons[mds_a].running())
self.assertTrue(self.mds_cluster.mds_daemons[mds_b].running())