* [RFC] md raid resync counter
@ 2013-11-01 12:59 Jack Wang
2013-11-01 23:48 ` NeilBrown
0 siblings, 1 reply; 5+ messages in thread
From: Jack Wang @ 2013-11-01 12:59 UTC (permalink / raw)
To: linux-raid, NeilBrown
Hi Neil and all,
Is there anyway to know:
1. How often does a raid start to resync?
2. How many bytes did it resync?
If not, for the first one, I think we cound add field into mddev like
resync_counter, increase when resync done, and annother field into
md_rdev to track how many bytes synced to the outdated disk?
Regards,
Jack
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] md raid resync counter
2013-11-01 12:59 [RFC] md raid resync counter Jack Wang
@ 2013-11-01 23:48 ` NeilBrown
2013-11-04 9:26 ` Jack Wang
0 siblings, 1 reply; 5+ messages in thread
From: NeilBrown @ 2013-11-01 23:48 UTC (permalink / raw)
To: Jack Wang; +Cc: linux-raid
[-- Attachment #1: Type: text/plain, Size: 548 bytes --]
On Fri, 01 Nov 2013 13:59:40 +0100 Jack Wang <xjtuwjp@gmail.com> wrote:
> Hi Neil and all,
>
> Is there anyway to know:
>
> 1. How often does a raid start to resync?
Look at your logs?
> 2. How many bytes did it resync?
Look at "mismatch_cnt" in sysfs (and multiply by 512).
NeilBrown
>
> If not, for the first one, I think we cound add field into mddev like
> resync_counter, increase when resync done, and annother field into
> md_rdev to track how many bytes synced to the outdated disk?
>
> Regards,
> Jack
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] md raid resync counter
2013-11-01 23:48 ` NeilBrown
@ 2013-11-04 9:26 ` Jack Wang
2013-11-05 5:12 ` NeilBrown
0 siblings, 1 reply; 5+ messages in thread
From: Jack Wang @ 2013-11-04 9:26 UTC (permalink / raw)
To: NeilBrown; +Cc: linux-raid
On 11/02/2013 12:48 AM, NeilBrown wrote:
> On Fri, 01 Nov 2013 13:59:40 +0100 Jack Wang <xjtuwjp@gmail.com> wrote:
>
>> Hi Neil and all,
>>
>> Is there anyway to know:
>>
>> 1. How often does a raid start to resync?
>
> Look at your logs?
>
>> 2. How many bytes did it resync?
>
> Look at "mismatch_cnt" in sysfs (and multiply by 512).
>
> NeilBrown
>
>
Thanks Neil,
You're always very helpful :)
About the second one. As I checked in my system kernel 3.4.51
when raid is resync:
cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 dm-1[3] dm-2[2]
23762944 blocks super 1.2 [2/1] [_U]
[==>..................] recovery = 10.7% (2562240/23762944)
finish=7.5min speed=46565K/sec
# cat /sys/block/md1/md/mismatch_cnt
0
cat /sys/block/md1/md/degraded
1
cat /sys/block/md1/md/mismatch_cnt
0
# cat /sys/block/md1/md/sync_completed
8911488 / 47525888
mismatch_cnt is 0, sync_completed look what I want?
Jack
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] md raid resync counter
2013-11-04 9:26 ` Jack Wang
@ 2013-11-05 5:12 ` NeilBrown
2013-11-05 9:16 ` Jack Wang
0 siblings, 1 reply; 5+ messages in thread
From: NeilBrown @ 2013-11-05 5:12 UTC (permalink / raw)
To: Jack Wang; +Cc: linux-raid
[-- Attachment #1: Type: text/plain, Size: 1805 bytes --]
On Mon, 04 Nov 2013 10:26:42 +0100 Jack Wang <xjtuwjp@gmail.com> wrote:
> On 11/02/2013 12:48 AM, NeilBrown wrote:
> > On Fri, 01 Nov 2013 13:59:40 +0100 Jack Wang <xjtuwjp@gmail.com> wrote:
> >
> >> Hi Neil and all,
> >>
> >> Is there anyway to know:
> >>
> >> 1. How often does a raid start to resync?
> >
> > Look at your logs?
> >
> >> 2. How many bytes did it resync?
> >
> > Look at "mismatch_cnt" in sysfs (and multiply by 512).
> >
> > NeilBrown
> >
> >
> Thanks Neil,
>
> You're always very helpful :)
>
> About the second one. As I checked in my system kernel 3.4.51
>
> when raid is resync:
> cat /proc/mdstat
> Personalities : [raid1]
> md1 : active raid1 dm-1[3] dm-2[2]
> 23762944 blocks super 1.2 [2/1] [_U]
> [==>..................] recovery = 10.7% (2562240/23762944)
> finish=7.5min speed=46565K/sec
This array is doing "recovery", not "resync".
"Resync" is when the devices should all contains the same data but maybe
don't due to some error. So md/raid1 checks and fixes the errors.
"recovery" is when a spare has been added and data is being copied onto it.
> # cat /sys/block/md1/md/mismatch_cnt
> 0
>
> cat /sys/block/md1/md/degraded
> 1
> cat /sys/block/md1/md/mismatch_cnt
> 0
> # cat /sys/block/md1/md/sync_completed
> 8911488 / 47525888
>
> mismatch_cnt is 0, sync_completed look what I want?
"sync_completed" is a number which is somewhat smaller than the number of
sectors that have been be processed by the current
sync/repair/recover/whatever.
Slightly smaller because it is only updated occasionally.
I don't really know what you want because you didn't say what you would do
with the information, but it is possible that this is what you want.
>
> Jack
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] md raid resync counter
2013-11-05 5:12 ` NeilBrown
@ 2013-11-05 9:16 ` Jack Wang
0 siblings, 0 replies; 5+ messages in thread
From: Jack Wang @ 2013-11-05 9:16 UTC (permalink / raw)
To: NeilBrown; +Cc: linux-raid
On 11/05/2013 06:12 AM, NeilBrown wrote:
> On Mon, 04 Nov 2013 10:26:42 +0100 Jack Wang <xjtuwjp@gmail.com> wrote:
>
>> On 11/02/2013 12:48 AM, NeilBrown wrote:
>>> On Fri, 01 Nov 2013 13:59:40 +0100 Jack Wang <xjtuwjp@gmail.com> wrote:
>>>
>>>> Hi Neil and all,
>>>>
>>>> Is there anyway to know:
>>>>
>>>> 1. How often does a raid start to resync?
>>>
>>> Look at your logs?
>>>
>>>> 2. How many bytes did it resync?
>>>
>>> Look at "mismatch_cnt" in sysfs (and multiply by 512).
>>>
>>> NeilBrown
>>>
>>>
>> Thanks Neil,
>>
>> You're always very helpful :)
>>
>> About the second one. As I checked in my system kernel 3.4.51
>>
>> when raid is resync:
>> cat /proc/mdstat
>> Personalities : [raid1]
>> md1 : active raid1 dm-1[3] dm-2[2]
>> 23762944 blocks super 1.2 [2/1] [_U]
>> [==>..................] recovery = 10.7% (2562240/23762944)
>> finish=7.5min speed=46565K/sec
>
> This array is doing "recovery", not "resync".
>
> "Resync" is when the devices should all contains the same data but maybe
> don't due to some error. So md/raid1 checks and fixes the errors.
> "recovery" is when a spare has been added and data is being copied onto it.
>
>
>> # cat /sys/block/md1/md/mismatch_cnt
>> 0
>>
>> cat /sys/block/md1/md/degraded
>> 1
>> cat /sys/block/md1/md/mismatch_cnt
>> 0
>> # cat /sys/block/md1/md/sync_completed
>> 8911488 / 47525888
>>
>> mismatch_cnt is 0, sync_completed look what I want?
>
> "sync_completed" is a number which is somewhat smaller than the number of
> sectors that have been be processed by the current
> sync/repair/recover/whatever.
>
> Slightly smaller because it is only updated occasionally.
>
> I don't really know what you want because you didn't say what you would do
> with the information, but it is possible that this is what you want.
Thanks Neil for clarification.
I think we need track both recovery and resync status, mismatch_cnt and
sync_completed are what we want.
Regards,
Jack
>
>
>>
>> Jack
>
>
> NeilBrown
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-11-05 9:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-01 12:59 [RFC] md raid resync counter Jack Wang
2013-11-01 23:48 ` NeilBrown
2013-11-04 9:26 ` Jack Wang
2013-11-05 5:12 ` NeilBrown
2013-11-05 9:16 ` Jack Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).