Skip to content

Commit 592a199

Browse files
authored
Merge pull request ceph#59875 from joscollin/wip-B68131-revert-sync-duration
cephfs_mirror: revert sync_duration to seconds Reviewed-by: Venky Shankar <[email protected]>
2 parents aa6b09b + 42d89df commit 592a199

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

doc/cephfs/cephfs-mirroring.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ command is of format `filesystem-name@filesystem-id peer-uuid`::
340340
"last_synced_snap": {
341341
"id": 120,
342342
"name": "snap1",
343-
"sync_duration": 0.079997898999999997,
343+
"sync_duration": 3,
344344
"sync_time_stamp": "274900.558797s",
345345
"sync_bytes": 52428800
346346
},
@@ -374,7 +374,7 @@ When a directory is currently being synchronized, the mirror daemon marks it as
374374
"last_synced_snap": {
375375
"id": 120,
376376
"name": "snap1",
377-
"sync_duration": 0.079997898999999997,
377+
"sync_duration": 3,
378378
"sync_time_stamp": "274900.558797s",
379379
"sync_bytes": 52428800
380380
},
@@ -403,7 +403,7 @@ E.g., adding a regular file for synchronization would result in failed status::
403403
"last_synced_snap": {
404404
"id": 121,
405405
"name": "snap2",
406-
"sync_duration": 300,
406+
"sync_duration": 5,
407407
"sync_time_stamp": "500900.600797s",
408408
"sync_bytes": 78643200
409409
},
@@ -439,7 +439,7 @@ In the remote filesystem::
439439
"last_synced_snap": {
440440
"id": 120,
441441
"name": "snap1",
442-
"sync_duration": 0.079997898999999997,
442+
"sync_duration": 3,
443443
"sync_time_stamp": "274900.558797s"
444444
},
445445
"snaps_synced": 2,
@@ -513,16 +513,16 @@ CephFS exports mirroring metrics as :ref:`Labeled Perf Counters` which will be c
513513
- The total number of snapshots renamed
514514
* - avg_sync_time
515515
- Gauge
516-
- The average time (ms) taken by all snapshot synchronizations
516+
- The average time taken by all snapshot synchronizations
517517
* - last_synced_start
518518
- Gauge
519-
- The sync start time (ms) of the last synced snapshot
519+
- The sync start time of the last synced snapshot
520520
* - last_synced_end
521521
- Gauge
522-
- The sync end time (ms) of the last synced snapshot
522+
- The sync end time of the last synced snapshot
523523
* - last_synced_duration
524524
- Gauge
525-
- The time duration (ms) of the last synchronization
525+
- The time duration of the last synchronization
526526
* - last_synced_bytes
527527
- counter
528528
- The total bytes being synchronized for the last synced snapshot

qa/tasks/cephfs/test_mirroring.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ def test_cephfs_mirror_stats(self):
560560

561561
# create a bunch of files in a directory to snap
562562
self.mount_a.run_shell(["mkdir", "d0"])
563-
for i in range(50):
563+
for i in range(100):
564564
self.mount_a.write_n_mb(os.path.join('d0', f'file.{i}'), 1)
565565

566566
self.enable_mirroring(self.primary_fs_name, self.primary_fs_id)
@@ -574,7 +574,7 @@ def test_cephfs_mirror_stats(self):
574574
# take a snapshot
575575
self.mount_a.run_shell(["mkdir", "d0/.snap/snap0"])
576576

577-
time.sleep(30)
577+
time.sleep(60)
578578
self.check_peer_status(self.primary_fs_name, self.primary_fs_id,
579579
"client.mirror_remote@ceph", '/d0', 'snap0', 1)
580580
self.verify_snapshot('d0', 'snap0')
@@ -586,18 +586,18 @@ def test_cephfs_mirror_stats(self):
586586
self.assertGreater(second["counters"]["last_synced_start"], first["counters"]["last_synced_start"])
587587
self.assertGreater(second["counters"]["last_synced_end"], second["counters"]["last_synced_start"])
588588
self.assertGreater(second["counters"]["last_synced_duration"], 0)
589-
self.assertEquals(second["counters"]["last_synced_bytes"], 52428800) # last_synced_bytes = 50 files of 1MB size each
589+
self.assertEquals(second["counters"]["last_synced_bytes"], 104857600) # last_synced_bytes = 100 files of 1MB size each
590590

591591
# some more IO
592-
for i in range(75):
592+
for i in range(150):
593593
self.mount_a.write_n_mb(os.path.join('d0', f'more_file.{i}'), 1)
594594

595595
time.sleep(60)
596596

597597
# take another snapshot
598598
self.mount_a.run_shell(["mkdir", "d0/.snap/snap1"])
599599

600-
time.sleep(60)
600+
time.sleep(120)
601601
self.check_peer_status(self.primary_fs_name, self.primary_fs_id,
602602
"client.mirror_remote@ceph", '/d0', 'snap1', 2)
603603
self.verify_snapshot('d0', 'snap1')
@@ -609,7 +609,7 @@ def test_cephfs_mirror_stats(self):
609609
self.assertGreater(third["counters"]["last_synced_start"], second["counters"]["last_synced_end"])
610610
self.assertGreater(third["counters"]["last_synced_end"], third["counters"]["last_synced_start"])
611611
self.assertGreater(third["counters"]["last_synced_duration"], 0)
612-
self.assertEquals(third["counters"]["last_synced_bytes"], 78643200) # last_synced_bytes = 75 files of 1MB size each
612+
self.assertEquals(third["counters"]["last_synced_bytes"], 157286400) # last_synced_bytes = 150 files of 1MB size each
613613

614614
# delete a snapshot
615615
self.mount_a.run_shell(["rmdir", "d0/.snap/snap0"])

src/tools/cephfs_mirror/PeerReplayer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ int PeerReplayer::do_sync_snaps(const std::string &dir_root) {
16871687
double duration = 0;
16881688
for (; it != local_snap_map.end(); ++it) {
16891689
if (m_perf_counters) {
1690-
start = std::chrono::duration_cast<std::chrono::milliseconds>(clock::now().time_since_epoch()).count();
1690+
start = std::chrono::duration_cast<std::chrono::seconds>(clock::now().time_since_epoch()).count();
16911691
utime_t t;
16921692
t.set_from_double(start);
16931693
m_perf_counters->tset(l_cephfs_mirror_peer_replayer_last_synced_start, t);
@@ -1706,7 +1706,7 @@ int PeerReplayer::do_sync_snaps(const std::string &dir_root) {
17061706
}
17071707
if (m_perf_counters) {
17081708
m_perf_counters->inc(l_cephfs_mirror_peer_replayer_snaps_synced);
1709-
end = std::chrono::duration_cast<std::chrono::milliseconds>(clock::now().time_since_epoch()).count();
1709+
end = std::chrono::duration_cast<std::chrono::seconds>(clock::now().time_since_epoch()).count();
17101710
utime_t t;
17111711
t.set_from_double(end);
17121712
m_perf_counters->tset(l_cephfs_mirror_peer_replayer_last_synced_end, t);

0 commit comments

Comments
 (0)