All of lore.kernel.org
 help / color / mirror / Atom feed
* dm-era: metadata reuse after reboot possible?
@ 2016-10-21  9:29 Markus Hentsch
  2016-10-31 11:37 ` Edward Thornber
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Hentsch @ 2016-10-21  9:29 UTC (permalink / raw)
  To: dm-devel


[-- Attachment #1.1: Type: text/plain, Size: 2308 bytes --]

Hello,

is it possible for the dm-era metadata to survive reboots?

The official dm-era documentation states under "Resilience":

    Metadata is updated on disk before a write to a previously unwritten
    block is performed.  As such dm-era should not be effected by a hard
    crash such as power failure.

That's why I initially assumed that I may continue (re)using the
metadata after reboots without wiping it (i.e. resetting the eras and
block tracking). But is that actually the case?


Using a Ubuntu trusty x64 VM with 2 additional virtual HDDs (sdb and
sdc, 256MB each), I set up dm-era after bootup like this:

    root@alice:~# dmsetup create era-meta --table "0 256 linear /dev/sdb 0"
    root@alice:~# dmsetup create era --table "0 524288 era /dev/mapper/era-meta /dev/sdc 4096"
    root@alice:~# dmsetup create era-access --table "0 256 linear /dev/mapper/era-meta 0"


When I reboot and repeat the commands above, the layout is recreated
correctly (according to lsblk). However, taking a metadata snapshot and
trying to access the metadata using era_dump or era_invalidate fails, e.g.:

    root@alice:~# dmsetup message era 0 take_metadata_snap
    root@alice:~# era_dump /dev/mapper/era-access
    <superblock uuid="" block_size="4096" nr_blocks="128" current_era="3">
    metadata contains errors (run era_check for details).
    perhaps you wanted to run with --repair ?

    root@alice:~# era_check /dev/mapper/era-access 
    examining superblock
    missing eras from writeset tree
      value size mismatch: expected 12, but got 8.  This is not the btree you are looking for.

    era_check: /usr/include/boost/optional/optional.hpp:1004: boost::optional<T>::reference_const_type
      boost::optional<T>::get() const [with T = unsigned int; boost::optional<T>::reference_const_type =
      const unsigned int&]: Assertion `this->is_initialized()' failed.
    Aborted


It doesn't matter if I take and drop any metadata snapshots or write to
the era device before the reboot or not.
Do I have to start over and wipe the metadata device directly after
reboot or is there some way to continue using it, i.e. recovering its
state when recreating the previous dmsetup layout?


Best regards,

Markus Hentsch
Cloud&Heat Technologies

[-- Attachment #1.2: Type: text/html, Size: 2768 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dm-era: metadata reuse after reboot possible?
  2016-10-21  9:29 dm-era: metadata reuse after reboot possible? Markus Hentsch
@ 2016-10-31 11:37 ` Edward Thornber
  2017-04-19 11:32   ` Markus Hentsch
  0 siblings, 1 reply; 5+ messages in thread
From: Edward Thornber @ 2016-10-31 11:37 UTC (permalink / raw)
  To: Markus Hentsch; +Cc: dm-devel

On Fri, Oct 21, 2016 at 11:29:26AM +0200, Markus Hentsch wrote:
> Hello,
> 
> is it possible for the dm-era metadata to survive reboots?

No, you certainly should be able to continue using the metadata.  I
don't have time to look at this for the next couple of weeks, but
after that will definitely fix.

- Joe

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dm-era: metadata reuse after reboot possible?
  2016-10-31 11:37 ` Edward Thornber
@ 2017-04-19 11:32   ` Markus Hentsch
  2017-04-19 16:18     ` Somasundaram Krishnasamy
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Hentsch @ 2017-04-19 11:32 UTC (permalink / raw)
  To: Edward Thornber; +Cc: dm-devel


[-- Attachment #1.1: Type: text/plain, Size: 3007 bytes --]

Hello, it's been a while. I've also been busy with other stuff in the
last months but now I'm back stuck at this issue. Has there been any
progress on this?

On Mo, Oct 31, 2016 at 12:37, Edward Thornber wrote:
> On Fri, Oct 21, 2016 at 11:29:26AM +0200, Markus Hentsch wrote:
>> Hello,
>>
>> is it possible for the dm-era metadata to survive reboots?
> No, you certainly should be able to continue using the metadata.  I
> don't have time to look at this for the next couple of weeks, but
> after that will definitely fix.
>
> - Joe

For reference, my original message from Fri, Oct 21, 2016 was:
> Hello,
>
> is it possible for the dm-era metadata to survive reboots?
>
> The official dm-era documentation states under "Resilience":
>
>     Metadata is updated on disk before a write to a previously unwritten
>     block is performed.  As such dm-era should not be effected by a hard
>     crash such as power failure.
>
> That's why I initially assumed that I may continue (re)using the
> metadata after reboots without wiping it (i.e. resetting the eras and
> block tracking). But is that actually the case?
>
>
> Using a Ubuntu trusty x64 VM with 2 additional virtual HDDs (sdb and
> sdc, 256MB each), I set up dm-era after bootup like this:
>
>     root@alice:~# dmsetup create era-meta --table "0 256 linear /dev/sdb 0"
>     root@alice:~# dmsetup create era --table "0 524288 era /dev/mapper/era-meta /dev/sdc 4096"
>     root@alice:~# dmsetup create era-access --table "0 256 linear /dev/mapper/era-meta 0"
>
>
> When I reboot and repeat the commands above, the layout is recreated
> correctly (according to lsblk). However, taking a metadata snapshot
> and trying to access the metadata using era_dump or era_invalidate
> fails, e.g.:
>
>     root@alice:~# dmsetup message era 0 take_metadata_snap
>     root@alice:~# era_dump /dev/mapper/era-access
>     <superblock uuid="" block_size="4096" nr_blocks="128" current_era="3">
>     metadata contains errors (run era_check for details).
>     perhaps you wanted to run with --repair ?
>
>     root@alice:~# era_check /dev/mapper/era-access 
>     examining superblock
>     missing eras from writeset tree
>       value size mismatch: expected 12, but got 8.  This is not the btree you are looking for.
>
>     era_check: /usr/include/boost/optional/optional.hpp:1004: boost::optional<T>::reference_const_type
>       boost::optional<T>::get() const [with T = unsigned int; boost::optional<T>::reference_const_type =
>       const unsigned int&]: Assertion `this->is_initialized()' failed.
>     Aborted
>
>
> It doesn't matter if I take and drop any metadata snapshots or write
> to the era device before the reboot or not.
> Do I have to start over and wipe the metadata device directly after
> reboot or is there some way to continue using it, i.e. recovering its
> state when recreating the previous dmsetup layout?

Best regards,

Markus Hentsch
Cloud&Heat Technologies

[-- Attachment #1.2: Type: text/html, Size: 3751 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dm-era: metadata reuse after reboot possible?
  2017-04-19 11:32   ` Markus Hentsch
@ 2017-04-19 16:18     ` Somasundaram Krishnasamy
  2017-04-20 11:55       ` Markus Hentsch
  0 siblings, 1 reply; 5+ messages in thread
From: Somasundaram Krishnasamy @ 2017-04-19 16:18 UTC (permalink / raw)
  To: Markus Hentsch, Edward Thornber; +Cc: dm-devel

I have sent a patch recently for review.

https://www.redhat.com/archives/dm-devel/2017-April/msg00138.html

It should fix this issue.

Regards,
Somu.

On 4/19/2017 6:32 AM, Markus Hentsch wrote:
> Hello, it's been a while. I've also been busy with other stuff in the last months but now I'm back stuck at this issue. Has there been any progress on this?
>
> On Mo, Oct 31, 2016 at 12:37, Edward Thornber wrote:
>> On Fri, Oct 21, 2016 at 11:29:26AM +0200, Markus Hentsch wrote:
>>> Hello,
>>>
>>> is it possible for the dm-era metadata to survive reboots?
>> No, you certainly should be able to continue using the metadata.  I
>> don't have time to look at this for the next couple of weeks, but
>> after that will definitely fix.
>>
>> - Joe
>
> For reference, my original message from Fri, Oct 21, 2016 was:
>> Hello,
>>
>> is it possible for the dm-era metadata to survive reboots?
>>
>> The official dm-era documentation states under "Resilience":
>>
>>     Metadata is updated on disk before a write to a previously unwritten
>>     block is performed.  As such dm-era should not be effected by a hard
>>     crash such as power failure.
>>
>> That's why I initially assumed that I may continue (re)using the metadata after reboots without wiping it (i.e. resetting the eras and block tracking). But is that actually the case?
>>
>>
>> Using a Ubuntu trusty x64 VM with 2 additional virtual HDDs (sdb and sdc, 256MB each), I set up dm-era after bootup like this:
>>
>>     root@alice:~# dmsetup create era-meta --table "0 256 linear /dev/sdb 0"
>>     root@alice:~# dmsetup create era --table "0 524288 era /dev/mapper/era-meta /dev/sdc 4096"
>>     root@alice:~# dmsetup create era-access --table "0 256 linear /dev/mapper/era-meta 0"
>>
>>
>> When I reboot and repeat the commands above, the layout is recreated correctly (according to lsblk). However, taking a metadata snapshot and trying to access the metadata using era_dump or
>> era_invalidate fails, e.g.:
>>
>>     root@alice:~# dmsetup message era 0 take_metadata_snap
>>     root@alice:~# era_dump /dev/mapper/era-access
>>     <superblock uuid="" block_size="4096" nr_blocks="128" current_era="3">
>>     metadata contains errors (run era_check for details).
>>     perhaps you wanted to run with --repair ?
>>
>>     root@alice:~# era_check /dev/mapper/era-access
>>     examining superblock
>>     missing eras from writeset tree
>>       value size mismatch: expected 12, but got 8.  This is not the btree you are looking for.
>>
>>     era_check: /usr/include/boost/optional/optional.hpp:1004: boost::optional<T>::reference_const_type
>>       boost::optional<T>::get() const [with T = unsigned int; boost::optional<T>::reference_const_type =
>>       const unsigned int&]: Assertion `this->is_initialized()' failed.
>>     Aborted
>>
>>
>> It doesn't matter if I take and drop any metadata snapshots or write to the era device before the reboot or not.
>> Do I have to start over and wipe the metadata device directly after reboot or is there some way to continue using it, i.e. recovering its state when recreating the previous dmsetup layout?
>
> Best regards,
>
> Markus Hentsch
> Cloud&Heat Technologies
>
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dm-era: metadata reuse after reboot possible?
  2017-04-19 16:18     ` Somasundaram Krishnasamy
@ 2017-04-20 11:55       ` Markus Hentsch
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Hentsch @ 2017-04-20 11:55 UTC (permalink / raw)
  To: Somasundaram Krishnasamy; +Cc: dm-devel, Edward Thornber

Dear Somu,

thanks for your quick response!

I applied your patch to the 4.4 kernel of a Ubuntu 16.04.2 VM and can
now confirm that the dm-era metadata survived every subsequent reboot so
far. Thank you!


Best regards,

Markus Hentsch
Cloud&Heat Technologies


On Apr 19, 2017 at 18:18 Somasundaram Krishnasamy wrote:
> I have sent a patch recently for review.
>
> https://www.redhat.com/archives/dm-devel/2017-April/msg00138.html
>
> It should fix this issue.
>
> Regards,
> Somu.
>
> On 4/19/2017 6:32 AM, Markus Hentsch wrote:
>> Hello, it's been a while. I've also been busy with other stuff in the
>> last months but now I'm back stuck at this issue. Has there been any
>> progress on this?
>>
>> On Mo, Oct 31, 2016 at 12:37, Edward Thornber wrote:
>>> On Fri, Oct 21, 2016 at 11:29:26AM +0200, Markus Hentsch wrote:
>>>> Hello,
>>>>
>>>> is it possible for the dm-era metadata to survive reboots?
>>> No, you certainly should be able to continue using the metadata.  I
>>> don't have time to look at this for the next couple of weeks, but
>>> after that will definitely fix.
>>>
>>> - Joe
>>
>> For reference, my original message from Fri, Oct 21, 2016 was:
>>> Hello,
>>>
>>> is it possible for the dm-era metadata to survive reboots?
>>>
>>> The official dm-era documentation states under "Resilience":
>>>
>>>     Metadata is updated on disk before a write to a previously
>>> unwritten
>>>     block is performed.  As such dm-era should not be effected by a
>>> hard
>>>     crash such as power failure.
>>>
>>> That's why I initially assumed that I may continue (re)using the
>>> metadata after reboots without wiping it (i.e. resetting the eras
>>> and block tracking). But is that actually the case?
>>>
>>>
>>> Using a Ubuntu trusty x64 VM with 2 additional virtual HDDs (sdb and
>>> sdc, 256MB each), I set up dm-era after bootup like this:
>>>
>>>     root@alice:~# dmsetup create era-meta --table "0 256 linear
>>> /dev/sdb 0"
>>>     root@alice:~# dmsetup create era --table "0 524288 era
>>> /dev/mapper/era-meta /dev/sdc 4096"
>>>     root@alice:~# dmsetup create era-access --table "0 256 linear
>>> /dev/mapper/era-meta 0"
>>>
>>>
>>> When I reboot and repeat the commands above, the layout is recreated
>>> correctly (according to lsblk). However, taking a metadata snapshot
>>> and trying to access the metadata using era_dump or
>>> era_invalidate fails, e.g.:
>>>
>>>     root@alice:~# dmsetup message era 0 take_metadata_snap
>>>     root@alice:~# era_dump /dev/mapper/era-access
>>>     <superblock uuid="" block_size="4096" nr_blocks="128"
>>> current_era="3">
>>>     metadata contains errors (run era_check for details).
>>>     perhaps you wanted to run with --repair ?
>>>
>>>     root@alice:~# era_check /dev/mapper/era-access
>>>     examining superblock
>>>     missing eras from writeset tree
>>>       value size mismatch: expected 12, but got 8.  This is not the
>>> btree you are looking for.
>>>
>>>     era_check: /usr/include/boost/optional/optional.hpp:1004:
>>> boost::optional<T>::reference_const_type
>>>       boost::optional<T>::get() const [with T = unsigned int;
>>> boost::optional<T>::reference_const_type =
>>>       const unsigned int&]: Assertion `this->is_initialized()' failed.
>>>     Aborted
>>>
>>>
>>> It doesn't matter if I take and drop any metadata snapshots or write
>>> to the era device before the reboot or not.
>>> Do I have to start over and wipe the metadata device directly after
>>> reboot or is there some way to continue using it, i.e. recovering
>>> its state when recreating the previous dmsetup layout?
>>
>> Best regards,
>>
>> Markus Hentsch
>> Cloud&Heat Technologies
>>
>>
>> -- 
>> dm-devel mailing list
>> dm-devel@redhat.com
>> https://www.redhat.com/mailman/listinfo/dm-devel
>>
>
> -- 
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-20 11:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-21  9:29 dm-era: metadata reuse after reboot possible? Markus Hentsch
2016-10-31 11:37 ` Edward Thornber
2017-04-19 11:32   ` Markus Hentsch
2017-04-19 16:18     ` Somasundaram Krishnasamy
2017-04-20 11:55       ` Markus Hentsch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.