Thread: sysSettings::Flush()

sysSettings::Flush()

From
Vladimir Kokovic
Date:
Hi,,

New method sysSettings::Flush()

With this patch every server setting goes immediately in persistent storage.
At this moment it goes in persistent storage only when pgAdmin is
normally finished.

For other settings every third request will immediately put settings
in persistent storage.

Best regards
Vladimir Kokovic
Belgrade, Serbia, 6.October 2012

Attachment

Re: sysSettings::Flush()

From
Dave Page
Date:
Hi

On Sat, Oct 6, 2012 at 6:57 AM, Vladimir Kokovic
<vladimir.kokovic@gmail.com> wrote:
> Hi,,
>
> New method sysSettings::Flush()
>
> With this patch every server setting goes immediately in persistent storage.
> At this moment it goes in persistent storage only when pgAdmin is
> normally finished.
>
> For other settings every third request will immediately put settings
> in persistent storage.

What's the rationale for that? It doesn't seem like it would be very
expensive to write all settings immediately.


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: sysSettings::Flush()

From
Vladimir Kokovic
Date:
Hi,

That is variant for somebody who don't want flush() on every setting.
My preferred value is 0 (immediately).

Best regards
Vladimir Kokovic
Belgrade, Serbia, 9.October 2012

On 10/9/12, Dave Page <dpage@pgadmin.org> wrote:
> Hi
>
> On Sat, Oct 6, 2012 at 6:57 AM, Vladimir Kokovic
> <vladimir.kokovic@gmail.com> wrote:
>> Hi,,
>>
>> New method sysSettings::Flush()
>>
>> With this patch every server setting goes immediately in persistent
>> storage.
>> At this moment it goes in persistent storage only when pgAdmin is
>> normally finished.
>>
>> For other settings every third request will immediately put settings
>> in persistent storage.
>
> What's the rationale for that? It doesn't seem like it would be very
> expensive to write all settings immediately.
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: sysSettings::Flush()

From
Dave Page
Date:
On Tue, Oct 9, 2012 at 5:21 PM, Vladimir Kokovic
<vladimir.kokovic@gmail.com> wrote:
> Hi,
>
> That is variant for somebody who don't want flush() on every setting.
> My preferred value is 0 (immediately).

Doesn't seem particularly configurable though :-). I think flushing
every time is fine - can you make that tweak and resend the patch
please?

On a related note; I'm still having trouble with your patches. This
one gives the following when I try to apply it:

raptor:pgAdmin3 dpage$ patch -p0 < ~/Downloads/pgadmin3-2.patch
patch: **** unexpected `***' at line 12: ***
a/pgadmin/include/utils/sysSettings.h

How did you generate it? Was there any manual adjustment made that
might have broken it?


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: sysSettings::Flush()

From
Vladimir Kokovic
Date:
Hi,

Flushing every time version.

Best regards
Vladimir Kokovic
Belgrade, Serbia, 10.October 2012

Attachment

Re: sysSettings::Flush()

From
Dave Page
Date:
On Wed, Oct 10, 2012 at 5:38 AM, Vladimir Kokovic
<vladimir.kokovic@gmail.com> wrote:
> Hi,
>
> Flushing every time version.

Thanks, but it still won't apply. Using git apply (most definitely the
correct option), I get:

raptor:pgAdmin3 dpage$ git apply ~/Downloads/pgadmin3-2.patch
fatal: unrecognized input

Using patch:

raptor:pgAdmin3 dpage$ patch -p1 < ~/Downloads/pgadmin3-flush.patch
patching file pgadmin/include/utils/sysSettings.h
patch unexpectedly ends in middle of line
patching file pgadmin/utils/sysSettings.cpp
patch unexpectedly ends in middle of line

How are you generating it? A simple "git diff > patch.diff" should
work just fine. Do you have any options in your git config file that
might be causing the output to be mangled?

Guillaume, can you apply the patch?

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: sysSettings::Flush()

From
Vladimir Kokovic
Date:
Hi,

I don't know what is problem !
Maybe some blank line missing,
Try to add empty line at the end of file.

My git diff command:

cd pgadmin3; git diff master vk-20120512-pgadmin3 | filterdiff
--format=context > /tmp/pgadmin3.patch; cd ../


Best regards
Vladimir Kokovic
Belgrade, Serbia, 10.October 2012


On 10/10/12, Dave Page <dpage@pgadmin.org> wrote:
> On Wed, Oct 10, 2012 at 5:38 AM, Vladimir Kokovic
> <vladimir.kokovic@gmail.com> wrote:
>> Hi,
>>
>> Flushing every time version.
>
> Thanks, but it still won't apply. Using git apply (most definitely the
> correct option), I get:
>
> raptor:pgAdmin3 dpage$ git apply ~/Downloads/pgadmin3-2.patch
> fatal: unrecognized input
>
> Using patch:
>
> raptor:pgAdmin3 dpage$ patch -p1 < ~/Downloads/pgadmin3-flush.patch
> patching file pgadmin/include/utils/sysSettings.h
> patch unexpectedly ends in middle of line
> patching file pgadmin/utils/sysSettings.cpp
> patch unexpectedly ends in middle of line
>
> How are you generating it? A simple "git diff > patch.diff" should
> work just fine. Do you have any options in your git config file that
> might be causing the output to be mangled?
>
> Guillaume, can you apply the patch?
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: sysSettings::Flush()

From
Dave Page
Date:
On Wed, Oct 10, 2012 at 4:06 PM, Vladimir Kokovic
<vladimir.kokovic@gmail.com> wrote:
> Hi,
>
> I don't know what is problem !
> Maybe some blank line missing,
> Try to add empty line at the end of file.
>
> My git diff command:
>
> cd pgadmin3; git diff master vk-20120512-pgadmin3 | filterdiff
> --format=context > /tmp/pgadmin3.patch; cd ../

Oh, OK - please try that again, but don't pipe it through filterdiff.
I suspect that's what's causing the issue.

e.g.

cd pgadmin3; git diff master vk-20120512-pgadmin3 > /tmp/pgadmin3.patch; cd ../

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: sysSettings::Flush()

From
Vladimir Kokovic
Date:
Hi,
For me, that is correct patch, but should be applied with unix 'patch' program:

cd pgadmin3; patch --context -p1 <
/root/files/pgadmin/dave-good/pgadmin3.patch; cd ../

 Best regards
 Vladimir Kokovic
 Belgrade, Serbia, 10.October 2012

On 10/10/12, Dave Page <dpage@pgadmin.org> wrote:
> On Wed, Oct 10, 2012 at 4:06 PM, Vladimir Kokovic
> <vladimir.kokovic@gmail.com> wrote:
>> Hi,
>>
>> I don't know what is problem !
>> Maybe some blank line missing,
>> Try to add empty line at the end of file.
>>
>> My git diff command:
>>
>> cd pgadmin3; git diff master vk-20120512-pgadmin3 | filterdiff
>> --format=context > /tmp/pgadmin3.patch; cd ../
>
> Oh, OK - please try that again, but don't pipe it through filterdiff.
> I suspect that's what's causing the issue.
>
> e.g.
>
> cd pgadmin3; git diff master vk-20120512-pgadmin3 > /tmp/pgadmin3.patch; cd
> ../
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>


Re: sysSettings::Flush()

From
Dave Page
Date:
On Wed, Oct 10, 2012 at 4:58 PM, Vladimir Kokovic
<vladimir.kokovic@gmail.com> wrote:
> Hi,
> For me, that is correct patch, but should be applied with unix 'patch' program:
>
> cd pgadmin3; patch --context -p1 <
> /root/files/pgadmin/dave-good/pgadmin3.patch; cd ../

The project standard is a unified diff, the standard output from "git diff".

Thanks.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: sysSettings::Flush()

From
Guillaume Lelarge
Date:
On Wed, 2012-10-10 at 11:48 +0100, Dave Page wrote:
> On Wed, Oct 10, 2012 at 5:38 AM, Vladimir Kokovic
> <vladimir.kokovic@gmail.com> wrote:
> > Hi,
> >
> > Flushing every time version.
>
> Thanks, but it still won't apply. Using git apply (most definitely the
> correct option), I get:
>
> raptor:pgAdmin3 dpage$ git apply ~/Downloads/pgadmin3-2.patch
> fatal: unrecognized input
>
> Using patch:
>
> raptor:pgAdmin3 dpage$ patch -p1 < ~/Downloads/pgadmin3-flush.patch
> patching file pgadmin/include/utils/sysSettings.h
> patch unexpectedly ends in middle of line
> patching file pgadmin/utils/sysSettings.cpp
> patch unexpectedly ends in middle of line
>
> How are you generating it? A simple "git diff > patch.diff" should
> work just fine. Do you have any options in your git config file that
> might be causing the output to be mangled?
>
> Guillaume, can you apply the patch?
>

Nope, I have the exact same messages.


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com