Re: [ClusterLabs] Q: About a false negative of storage_mon
On Fri, Aug 5, 2022 at 9:30 AM Kazunori INOUE wrote: > > On Tue, Aug 2, 2022 at 11:09 PM Ken Gaillot wrote: > > > > On Tue, 2022-08-02 at 19:13 +0900, 井上和徳 wrote: > > > Hi, > > > > > > Since O_DIRECT is not specified in open() [1], it reads the buffer > > > cache and > > > may result in a false negative. I fear that this possibility > > > increases > > > in environments with large buffer cache and running disk-reading > > > applications > > > such as database. > > > > > > So, I think it's better to specify O_RDONLY|O_DIRECT, but what about > > > it? > > > (in this case, lseek() processing is unnecessary.) > > > > > > # I am ready to create a patch that works with O_DIRECT. Also, I > > > wouldn't mind > > > # a "change to add a new mode of inspection with O_DIRECT > > > # (add a option to storage_mon) while keeping the current inspection > > > process". > > > > > > [1] > > > https://github.com/ClusterLabs/resource-agents/blob/main/tools/storage_mon.c#L47-L90 > > > > > > Best Regards, > > > Kazunori INOUE > > > > I agree, it makes sense to use O_DIRECT when available. I don't think > > an option is necessary. > > > > However, O_DIRECT is not available on all OSes, so the configure script > > should detect support. Also, it is not supported by all filesystems, so > > if the open fails, we should retry without O_DIRECT. > > -- > > Ken Gaillot > > > > Thank you, everyone. > I will create a patch using O_DIRECT. > (I'm also interested in AIO, but I don't have a track record of using it, Not saying you have to use it nor that it is a perfect reference implementation but it is proven to work to a certain extent - and well - I know it ;-) https://github.com/ClusterLabs/sbd/blob/main/src/sbd-md.c Not sure as well if it is of much benefit for a usage pattern without a persistent daemon. And it is Linux proprietary. Unfortunately posix aio implementation seems not to be using the kernel-api (yet). What you could adopt from the sbd-code might be getting the block-size from the device instead of assuming 512 bytes (what iirc the current code does). Klaus > so I'm going to see it off this time.) > > Kazunori INOUE > > > > ___ > Manage your subscription: > https://lists.clusterlabs.org/mailman/listinfo/users > > ClusterLabs home: https://www.clusterlabs.org/ ___ Manage your subscription: https://lists.clusterlabs.org/mailman/listinfo/users ClusterLabs home: https://www.clusterlabs.org/
Re: [ClusterLabs] Q: About a false negative of storage_mon
On Tue, Aug 2, 2022 at 11:09 PM Ken Gaillot wrote: > > On Tue, 2022-08-02 at 19:13 +0900, 井上和徳 wrote: > > Hi, > > > > Since O_DIRECT is not specified in open() [1], it reads the buffer > > cache and > > may result in a false negative. I fear that this possibility > > increases > > in environments with large buffer cache and running disk-reading > > applications > > such as database. > > > > So, I think it's better to specify O_RDONLY|O_DIRECT, but what about > > it? > > (in this case, lseek() processing is unnecessary.) > > > > # I am ready to create a patch that works with O_DIRECT. Also, I > > wouldn't mind > > # a "change to add a new mode of inspection with O_DIRECT > > # (add a option to storage_mon) while keeping the current inspection > > process". > > > > [1] > > https://github.com/ClusterLabs/resource-agents/blob/main/tools/storage_mon.c#L47-L90 > > > > Best Regards, > > Kazunori INOUE > > I agree, it makes sense to use O_DIRECT when available. I don't think > an option is necessary. > > However, O_DIRECT is not available on all OSes, so the configure script > should detect support. Also, it is not supported by all filesystems, so > if the open fails, we should retry without O_DIRECT. > -- > Ken Gaillot > Thank you, everyone. I will create a patch using O_DIRECT. (I'm also interested in AIO, but I don't have a track record of using it, so I'm going to see it off this time.) Kazunori INOUE ___ Manage your subscription: https://lists.clusterlabs.org/mailman/listinfo/users ClusterLabs home: https://www.clusterlabs.org/
Re: [ClusterLabs] Q: About a false negative of storage_mon
On Tue, Aug 2, 2022 at 4:10 PM Ken Gaillot wrote: > > On Tue, 2022-08-02 at 19:13 +0900, 井上和徳 wrote: > > Hi, > > > > Since O_DIRECT is not specified in open() [1], it reads the buffer > > cache and > > may result in a false negative. I fear that this possibility > > increases > > in environments with large buffer cache and running disk-reading > > applications > > such as database. > > > > So, I think it's better to specify O_RDONLY|O_DIRECT, but what about > > it? > > (in this case, lseek() processing is unnecessary.) > > > > # I am ready to create a patch that works with O_DIRECT. Also, I > > wouldn't mind > > # a "change to add a new mode of inspection with O_DIRECT > > # (add a option to storage_mon) while keeping the current inspection > > process". > > > > [1] > > https://github.com/ClusterLabs/resource-agents/blob/main/tools/storage_mon.c#L47-L90 > > > > Best Regards, > > Kazunori INOUE > > I agree, it makes sense to use O_DIRECT when available. I don't think > an option is necessary. Might as well be interesting to adjust block-size/alignment to the device. Another consideration could be to on top directly access the block-layer using aio. Both is being done in sbd (storage-based-death) and yes it as well adds Linux specific stuff that might have to be conditional for other OSs. Klaus > > However, O_DIRECT is not available on all OSes, so the configure script > should detect support. Also, it is not supported by all filesystems, so > if the open fails, we should retry without O_DIRECT. > -- > Ken Gaillot > > ___ > Manage your subscription: > https://lists.clusterlabs.org/mailman/listinfo/users > > ClusterLabs home: https://www.clusterlabs.org/ ___ Manage your subscription: https://lists.clusterlabs.org/mailman/listinfo/users ClusterLabs home: https://www.clusterlabs.org/
Re: [ClusterLabs] Q: About a false negative of storage_mon
On Tue, 2022-08-02 at 19:13 +0900, 井上和徳 wrote: > Hi, > > Since O_DIRECT is not specified in open() [1], it reads the buffer > cache and > may result in a false negative. I fear that this possibility > increases > in environments with large buffer cache and running disk-reading > applications > such as database. > > So, I think it's better to specify O_RDONLY|O_DIRECT, but what about > it? > (in this case, lseek() processing is unnecessary.) > > # I am ready to create a patch that works with O_DIRECT. Also, I > wouldn't mind > # a "change to add a new mode of inspection with O_DIRECT > # (add a option to storage_mon) while keeping the current inspection > process". > > [1] > https://github.com/ClusterLabs/resource-agents/blob/main/tools/storage_mon.c#L47-L90 > > Best Regards, > Kazunori INOUE I agree, it makes sense to use O_DIRECT when available. I don't think an option is necessary. However, O_DIRECT is not available on all OSes, so the configure script should detect support. Also, it is not supported by all filesystems, so if the open fails, we should retry without O_DIRECT. -- Ken Gaillot ___ Manage your subscription: https://lists.clusterlabs.org/mailman/listinfo/users ClusterLabs home: https://www.clusterlabs.org/
Re: [ClusterLabs] Q: About a false negative of storage_mon
Hello Kazunori-san, On 02/08/2022 12.13, 井上和徳 wrote: Hi, Since O_DIRECT is not specified in open() [1], it reads the buffer cache and may result in a false negative. I fear that this possibility increases in environments with large buffer cache and running disk-reading applications such as database. So, I think it's better to specify O_RDONLY|O_DIRECT, but what about it? (in this case, lseek() processing is unnecessary.) I will have to defer to Christine (in CC) to this email on why we didn´t use O_DIRECT. I have a vague recollection that some storage devices didn´t like the O_DIRECT option causing other issues later, but it´s been a while since I touched the code. # I am ready to create a patch that works with O_DIRECT. Also, I wouldn't mind # a "change to add a new mode of inspection with O_DIRECT # (add a option to storage_mon) while keeping the current inspection process". [1] https://github.com/ClusterLabs/resource-agents/blob/main/tools/storage_mon.c#L47-L90 It might be a very reasonable solution, tho let´s wait for an answer from Chrissie. Cheers Fabio ___ Manage your subscription: https://lists.clusterlabs.org/mailman/listinfo/users ClusterLabs home: https://www.clusterlabs.org/
[ClusterLabs] Q: About a false negative of storage_mon
Hi, Since O_DIRECT is not specified in open() [1], it reads the buffer cache and may result in a false negative. I fear that this possibility increases in environments with large buffer cache and running disk-reading applications such as database. So, I think it's better to specify O_RDONLY|O_DIRECT, but what about it? (in this case, lseek() processing is unnecessary.) # I am ready to create a patch that works with O_DIRECT. Also, I wouldn't mind # a "change to add a new mode of inspection with O_DIRECT # (add a option to storage_mon) while keeping the current inspection process". [1] https://github.com/ClusterLabs/resource-agents/blob/main/tools/storage_mon.c#L47-L90 Best Regards, Kazunori INOUE ___ Manage your subscription: https://lists.clusterlabs.org/mailman/listinfo/users ClusterLabs home: https://www.clusterlabs.org/