Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Use direct lctl device calls for snapshots #2364

Merged
merged 5 commits into from
Nov 30, 2020
Merged

Use direct lctl device calls for snapshots #2364

merged 5 commits into from
Nov 30, 2020

Conversation

jgrund
Copy link
Member

@jgrund jgrund commented Nov 5, 2020

Signed-off-by: Joe Grund jgrund@whamcloud.io


This change is Reviewable

@johnsonw
Copy link
Contributor

johnsonw commented Nov 6, 2020

[root@adm tmp]# iml snapshot list fs
+------------+----------+---------------------------------+-----------+---------+
| Filesystem | Snapshot | Creation Time                   | State     | Comment |
+============+==========+=================================+===========+=========+
| fs         | test     | Fri, 06 Nov 2020 22:54:55 +0000 | unmounted | ---     |
+------------+----------+---------------------------------+-----------+---------+

[root@mds1 ~]# iml-agent snapshot list fs-MDT0000
[Snapshot { filesystem_name: "fs", snapshot_name: "test", snapshot_fsname: "2c1accd5", modify_time: 2020-11-06T22:54:55Z, create_time: 2020-11-06T22:54:55Z, mounted: false, comment: None }]

[root@adm tmp]# iml snapshot destroy fs test
[1/1]   ✔ Destroying snapshot successful
[root@adm tmp]# iml snapshot list fs

[root@adm tmp]#

image

@johnsonw
Copy link
Contributor

johnsonw commented Nov 6, 2020

This is mostly working, but I see one problem still. When going from unmounted to mounted, the iml-agent will show this properly but it is not propagated up to the manager and reflected in the database. It may have something to do with how the daemon is working. I'm currently investigating.

@johnsonw
Copy link
Contributor

The snapshot mounting is now being reflected correctly:

[root@adm tmp]# iml snapshot list fs
+------------+----------+---------------------------------+---------+---------+
| Filesystem | Snapshot | Creation Time                   | State   | Comment |
+============+==========+=================================+=========+=========+
| fs         | test     | Tue, 10 Nov 2020 22:19:27 +0000 | mounted | ---     |
+------------+----------+---------------------------------+---------+---------+

@johnsonw johnsonw marked this pull request as ready for review November 11, 2020 01:19
@johnsonw johnsonw requested a review from a team November 11, 2020 15:05
@jgrund jgrund changed the base branch from master to extract-device-client November 11, 2020 15:47
@johnsonw
Copy link
Contributor

Testing update:

chroma=> select * from snapshot;
 id | filesystem_name | snapshot_name |      create_time       |      modify_time       | snapshot_fsname | mounted | comment
----+-----------------+---------------+------------------------+------------------------+-----------------+---------+---------
  1 | fs              | test          | 2020-11-11 21:12:28+00 | 2020-11-11 21:12:28+00 | 7c30140b        | t       |
(1 row)

chroma=> \q
[root@adm tmp]# iml snapshot list fs
+------------+----------+---------------------------------+---------+---------+
| Filesystem | Snapshot | Creation Time                   | State   | Comment |
+============+==========+=================================+=========+=========+
| fs         | test     | Wed, 11 Nov 2020 21:12:28 +0000 | mounted | ---     |
+------------+----------+---------------------------------+---------+---------+

[root@adm tmp]# iml snapshot unmount fs test
[1/1]   ✔ Unmounting snapshot successful

...

[root@adm tmp]# iml snapshot list fs
+------------+----------+---------------------------------+-----------+---------+
| Filesystem | Snapshot | Creation Time                   | State     | Comment |
+============+==========+=================================+===========+=========+
| fs         | test     | Wed, 11 Nov 2020 21:12:28 +0000 | unmounted | ---     |
+------------+----------+---------------------------------+-----------+---------+

@johnsonw
Copy link
Contributor

Testing with multiple snapshots:

[root@adm tmp]# iml snapshot create fs test2
[1/1]   ✔ Creating snapshot successful
[root@adm tmp]# iml snapshot list fs
+------------+----------+---------------------------------+-----------+---------+
| Filesystem | Snapshot | Creation Time                   | State     | Comment |
+============+==========+=================================+===========+=========+
| fs         | test     | Wed, 11 Nov 2020 21:12:28 +0000 | unmounted | ---     |
+------------+----------+---------------------------------+-----------+---------+
| fs         | test2    | Wed, 11 Nov 2020 21:43:16 +0000 | unmounted |         |
+------------+----------+---------------------------------+-----------+---------+

[root@adm tmp]# iml snapshot mount fs test2
[1/1]   ✔ Mounting snapshot successful
[root@adm tmp]# iml snapshot list fs
+------------+----------+---------------------------------+-----------+---------+
| Filesystem | Snapshot | Creation Time                   | State     | Comment |
+============+==========+=================================+===========+=========+
| fs         | test     | Wed, 11 Nov 2020 21:12:28 +0000 | unmounted | ---     |
+------------+----------+---------------------------------+-----------+---------+
| fs         | test2    | Wed, 11 Nov 2020 21:43:16 +0000 | mounted   |         |
+------------+----------+---------------------------------+-----------+---------+

[root@adm tmp]# iml snapshot create fs2 test3
[1/1]   ✔ Creating snapshot successful
[root@adm tmp]# iml snapshot list fs
+------------+----------+---------------------------------+-----------+---------+
| Filesystem | Snapshot | Creation Time                   | State     | Comment |
+============+==========+=================================+===========+=========+
| fs         | test     | Wed, 11 Nov 2020 21:12:28 +0000 | unmounted | ---     |
+------------+----------+---------------------------------+-----------+---------+
| fs         | test2    | Wed, 11 Nov 2020 21:43:16 +0000 | mounted   |         |
+------------+----------+---------------------------------+-----------+---------+

[root@adm tmp]# iml snapshot list fs2
+------------+----------+---------------------------------+-----------+---------+
| Filesystem | Snapshot | Creation Time                   | State     | Comment |
+============+==========+=================================+===========+=========+
| fs2        | test3    | Wed, 11 Nov 2020 21:44:26 +0000 | unmounted | ---     |
+------------+----------+---------------------------------+-----------+---------+

[root@adm tmp]# iml snapshot mount fs2 test3
[1/1]   ✔ Mounting snapshot successful
[root@adm tmp]# iml snapshot list fs2
+------------+----------+---------------------------------+---------+---------+
| Filesystem | Snapshot | Creation Time                   | State   | Comment |
+============+==========+=================================+=========+=========+
| fs2        | test3    | Wed, 11 Nov 2020 21:44:26 +0000 | mounted | ---     |
+------------+----------+---------------------------------+---------+---------+

[root@adm tmp]# iml snapshot list fs2
+------------+----------+---------------------------------+---------+---------+
| Filesystem | Snapshot | Creation Time                   | State   | Comment |
+============+==========+=================================+=========+=========+
| fs2        | test3    | Wed, 11 Nov 2020 21:44:26 +0000 | mounted | ---     |
+------------+----------+---------------------------------+---------+---------+

[root@adm tmp]# iml snapshot unmount fs2 test3
[1/1]   ✔ Unmounting snapshot successful
[root@adm tmp]# iml snapshot destroy fs2 test3
[1/1]   ✔ Destroying snapshot successful
[root@adm tmp]# iml snapshot create fs2 test
[1/1]   ✔ Creating snapshot successful
[root@adm tmp]# iml snapshot list fs2
+------------+----------+---------------------------------+-----------+---------+
| Filesystem | Snapshot | Creation Time                   | State     | Comment |
+============+==========+=================================+===========+=========+
| fs2        | test     | Wed, 11 Nov 2020 21:51:37 +0000 | unmounted | ---     |
+------------+----------+---------------------------------+-----------+---------+

[root@adm tmp]# iml snapshot mount fs2 test
[1/1]   ✔ Mounting snapshot successful
[root@adm tmp]# iml snapshot list fs2
+------------+----------+---------------------------------+---------+---------+
| Filesystem | Snapshot | Creation Time                   | State   | Comment |
+============+==========+=================================+=========+=========+
| fs2        | test     | Wed, 11 Nov 2020 21:51:37 +0000 | mounted | ---     |
+------------+----------+---------------------------------+---------+---------+

@johnsonw
Copy link
Contributor

johnsonw commented Nov 12, 2020

Test successfully built here: https://build.whamcloud.com/view/IML/job/manager-for-lustre/2893/

Base automatically changed from extract-device-client to master November 13, 2020 18:42
Copy link
Contributor

@nlinker nlinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 7 files at r1, 6 of 8 files at r2, 2 of 2 files at r4, 6 of 6 files at r5.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johnsonw)

jgrund and others added 5 commits November 18, 2020 12:19
Signed-off-by: Joe Grund <jgrund@whamcloud.io>
Signed-off-by: johnsonw <wjohnson@whamcloud.com>

Update the 'mounted' column to bool instead of Option<bool>

Signed-off-by: johnsonw <wjohnson@whamcloud.com>

Add sqlx data file

Signed-off-by: johnsonw <wjohnson@whamcloud.com>

Fixups

Signed-off-by: johnsonw <wjohnson@whamcloud.com>

sqlx data

Signed-off-by: johnsonw <wjohnson@whamcloud.com>

Fixup in gui

Signed-off-by: johnsonw <wjohnson@whamcloud.com>

Fix issue where snapshot mount status is not being updated.

Signed-off-by: johnsonw <wjohnson@whamcloud.com>

Update sqlx

Signed-off-by: johnsonw <wjohnson@whamcloud.com>
Signed-off-by: Joe Grund <jgrund@whamcloud.io>
Signed-off-by: johnsonw <wjohnson@whamcloud.com>
Signed-off-by: johnsonw <wjohnson@whamcloud.com>
@jgrund jgrund merged commit 1e9602d into master Nov 30, 2020
@jgrund jgrund deleted the snapshot-list2 branch November 30, 2020 15:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants