linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] lvmcache writethrough synchronisation at system startup
@ 2018-12-05  6:19 Marcin Wolcendorf
  2018-12-05 14:23 ` Zdenek Kabelac
  0 siblings, 1 reply; 4+ messages in thread
From: Marcin Wolcendorf @ 2018-12-05  6:19 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 1280 bytes --]

Hi Everyone,

Recently I have set up a simple lvmcache on my machine. This is a write-through
cache, so in my view it should never be necessary to copy data from the
cachepool to the origin LV. But this is exactly what happens: on system start
the 

lvs -o+cache_policy,cache_settings,cache_mode

displays something like:
  LV     VG   Attr       LSize   Pool     Origin       Data%  Meta%  Move Log Cpy%Sync Convert CachePolicy CacheSettings CacheMode   
  home   main Cwi-aoC---  21.83t [cache1] [home_corig] 99.99  0.55            90.39            smq                       writethrough

and for a next day or two it writes the whole cachepool to the origin. The data
on the cached LV seems fine as long as sha512 is concerned. 

Is this supposed to be that way?

My setup:
I have 2 mdraid devices: one 24T raid6, one 1T raid1, and one separate SSD. All
are LUKS-encrypted, SSD is partitioned into MBR boot partition, encrypted /boot
partition and a big encrypted partition for a PV. The encrypted block devices
(except /boot) are PVs in my VG. The 24T RAID holds the origin LV, the 1T RAID
is made into a cachepool.

BR,
M.W.

-- 
On a paper submitted by a physicist colleague:

"This isn't right.  This isn't even wrong."
		-- Wolfgang Pauli

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [linux-lvm] lvmcache writethrough synchronisation at system startup
  2018-12-05  6:19 [linux-lvm] lvmcache writethrough synchronisation at system startup Marcin Wolcendorf
@ 2018-12-05 14:23 ` Zdenek Kabelac
  2018-12-05 15:01   ` Marcin Wolcendorf
  0 siblings, 1 reply; 4+ messages in thread
From: Zdenek Kabelac @ 2018-12-05 14:23 UTC (permalink / raw)
  To: LVM general discussion and development, Marcin Wolcendorf

Dne 05. 12. 18 v 7:19 Marcin Wolcendorf napsal(a):
> Hi Everyone,
> 
> Recently I have set up a simple lvmcache on my machine. This is a write-through
> cache, so in my view it should never be necessary to copy data from the
> cachepool to the origin LV. But this is exactly what happens: on system start
> the
> 
> lvs -o+cache_policy,cache_settings,cache_mode
> 
> displays something like:
>    LV     VG   Attr       LSize   Pool     Origin       Data%  Meta%  Move Log Cpy%Sync Convert CachePolicy CacheSettings CacheMode
>    home   main Cwi-aoC---  21.83t [cache1] [home_corig] 99.99  0.55            90.39            smq                       writethrough
> 
> and for a next day or two it writes the whole cachepool to the origin. The data
> on the cached LV seems fine as long as sha512 is concerned.
> 
> Is this supposed to be that way?
> 
> My setup:
> I have 2 mdraid devices: one 24T raid6, one 1T raid1, and one separate SSD. All
> are LUKS-encrypted, SSD is partitioned into MBR boot partition, encrypted /boot
> partition and a big encrypted partition for a PV. The encrypted block devices
> (except /boot) are PVs in my VG. The 24T RAID holds the origin LV, the 1T RAID
> is made into a cachepool.

Hi

I'd say in your case it's very important which version of kernel is in use, as 
there very couple fixes solving this issue in not too long history.


Secondary issue is - it's always good idea there is correct shutdown process
instead of just 'power-off' althouhg in 'writethrough' case it should not be 
that big issue (but here applies the advice number one - use recent kernels).


Regards

Zdenek

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

* Re: [linux-lvm] lvmcache writethrough synchronisation at system startup
  2018-12-05 14:23 ` Zdenek Kabelac
@ 2018-12-05 15:01   ` Marcin Wolcendorf
  2018-12-06 11:32     ` Zdenek Kabelac
  0 siblings, 1 reply; 4+ messages in thread
From: Marcin Wolcendorf @ 2018-12-05 15:01 UTC (permalink / raw)
  To: linux-lvm

Hi,

Thanks for your reply!

On Wed, Dec 05, 2018 at 03:23:21PM +0100, Zdenek Kabelac wrote:
> Dne 05. 12. 18 v 7:19 Marcin Wolcendorf napsal(a):
> > My setup:
> > I have 2 mdraid devices: one 24T raid6, one 1T raid1, and one separate SSD. All
> > are LUKS-encrypted, SSD is partitioned into MBR boot partition, encrypted /boot
> > partition and a big encrypted partition for a PV. The encrypted block devices
> > (except /boot) are PVs in my VG. The 24T RAID holds the origin LV, the 1T RAID
> > is made into a cachepool.
> 
> Hi
> 
> I'd say in your case it's very important which version of kernel is in use,
> as there very couple fixes solving this issue in not too long history.

$ uname -a
Linux hal-9002 4.18.0-2-amd64 #1 SMP Debian 4.18.10-2 (2018-11-02) x86_64 GNU/Linux

I think it's not *that* old.
I searched for some info about this issue, but my google mojo left me and I
didn't find anything. Can you point me to some place - like commit or bug
description - where I could read about those fixes? 

> Secondary issue is - it's always good idea there is correct shutdown process
> instead of just 'power-off' althouhg in 'writethrough' case it should not be
> that big issue (but here applies the advice number one - use recent
> kernels).

OK, so how should the shutdown look like?

BR,
M.W.
-- 
Delta: We're Amtrak with wings.    -- David Letterman

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

* Re: [linux-lvm] lvmcache writethrough synchronisation at system startup
  2018-12-05 15:01   ` Marcin Wolcendorf
@ 2018-12-06 11:32     ` Zdenek Kabelac
  0 siblings, 0 replies; 4+ messages in thread
From: Zdenek Kabelac @ 2018-12-06 11:32 UTC (permalink / raw)
  To: LVM general discussion and development, Marcin Wolcendorf

Dne 05. 12. 18 v 16:01 Marcin Wolcendorf napsal(a):
> Hi,
> 
> Thanks for your reply!
> 
> On Wed, Dec 05, 2018 at 03:23:21PM +0100, Zdenek Kabelac wrote:
>> Dne 05. 12. 18 v 7:19 Marcin Wolcendorf napsal(a):
>>> My setup:
>>> I have 2 mdraid devices: one 24T raid6, one 1T raid1, and one separate SSD. All
>>> are LUKS-encrypted, SSD is partitioned into MBR boot partition, encrypted /boot
>>> partition and a big encrypted partition for a PV. The encrypted block devices
>>> (except /boot) are PVs in my VG. The 24T RAID holds the origin LV, the 1T RAID
>>> is made into a cachepool.
>>
>> Hi
>>
>> I'd say in your case it's very important which version of kernel is in use,
>> as there very couple fixes solving this issue in not too long history.
> 
> $ uname -a
> Linux hal-9002 4.18.0-2-amd64 #1 SMP Debian 4.18.10-2 (2018-11-02) x86_64 GNU/Linux
> 
> I think it's not *that* old.
> I searched for some info about this issue, but my google mojo left me and I
> didn't find anything. Can you point me to some place - like commit or bug
> description - where I could read about those fixes?
> 
>> Secondary issue is - it's always good idea there is correct shutdown process
>> instead of just 'power-off' althouhg in 'writethrough' case it should not be
>> that big issue (but here applies the advice number one - use recent
>> kernels).
> 
> OK, so how should the shutdown look like?
> 


On i.e. Fedora distribution all filesystems are unmounted and all LVs are 
deactivatated -  due to switch to shutdown 'ramdisk' (reusing the one from 
initial boot).


Zdenek

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

end of thread, other threads:[~2018-12-06 11:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05  6:19 [linux-lvm] lvmcache writethrough synchronisation at system startup Marcin Wolcendorf
2018-12-05 14:23 ` Zdenek Kabelac
2018-12-05 15:01   ` Marcin Wolcendorf
2018-12-06 11:32     ` Zdenek Kabelac

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).