Thread: Questions about document "Concurrenry control" section

Questions about document "Concurrenry control" section

From
iseki zero
Date:
Hello,

I found it difficult to understanding some paragraph in the document 
"Concurrency control" section.

 > The Repeatable Read mode provides a rigorous guarantee that each 
transaction sees a completely stable view of the database. However, this 
view will not necessarily always be consistent with some serial (one at 
a time) execution of concurrent transactions of the same level. For 
example, even a read-only transaction at this level may see a control 
record updated to show that a batch has been completed but/not/see one 
of the detail records which is logically part of the batch because it 
read an earlier revision of the control record. Attempts to enforce 
business rules by transactions running at this isolation level are not 
likely to work correctly without careful use of explicit locks to block 
conflicting transactions.

At: 

https://www.postgresql.org/docs/17/transaction-iso.html#XACT-REPEATABLE-READ:~:text=The%20Repeatable%20Read%20mode,to%20block%20conflicting%20transactions.

Specifically, I can't understand the example. Why in an earlier 
revision, the control record show that the batch has been completed? In 
my recognization, the control record state transation should be 
"running" -> "completed". And only after all batch operation completed 
then the control record will be changed to "completed".

The another big problem is, I interpret the whole batch operation is in 
one transaction. So, we can read updates from another uncommited yet 
transaction?? I read the front paragraph(Read Committed), the locking 
behaviour will effect the read view, and I understand the behaviour 
might still be exists in Repeatable Read. But the example said, 
read-only transaction.

Thank you

iseki zero




Re: Questions about document "Concurrenry control" section

From
Laurenz Albe
Date:
On Wed, 2024-10-09 at 18:07 +0800, iseki zero wrote:
> I found it difficult to understanding some paragraph in the document
> "Concurrency control" section.
>
>  > The Repeatable Read mode provides a rigorous guarantee that each
> transaction sees a completely stable view of the database. However, this
> view will not necessarily always be consistent with some serial (one at
> a time) execution of concurrent transactions of the same level. For
> example, even a read-only transaction at this level may see a control
> record updated to show that a batch has been completed but/not/see one
> of the detail records which is logically part of the batch because it
> read an earlier revision of the control record. Attempts to enforce
> business rules by transactions running at this isolation level are not
> likely to work correctly without careful use of explicit locks to block
> conflicting transactions.
>
> At:
>
https://www.postgresql.org/docs/17/transaction-iso.html#XACT-REPEATABLE-READ:~:text=The%20Repeatable%20Read%20mode,to%20block%20conflicting%20transactions.
>
> Specifically, I can't understand the example.

I think this is referring to this example:
https://wiki.postgresql.org/wiki/SSI#Deposit_Report

Yours,
Laurenz Albe



Re: Questions about document "Concurrenry control" section

From
iseki
Date:
Oh sorry, I should use [reply to all] instead of [reply]. I don't have 
much experience with mailing lists...

But why the mailing list haven't use the "Reply-To" header specify where 
to reply? Because the mail is you send to me directly?

Thank you.

On 2024/10/11 14:53, Laurenz Albe wrote:
> On Fri, 2024-10-11 at 11:04 +0800, admin@iseki.space wrote:
>> Maybe add the whole example or the URL to the document is better?
> You shouldn't address that reply to me personally...
>
> Yours,
> Laurenz Albe



Re: Questions about document "Concurrenry control" section

From
Erik Wienhold
Date:
On 2024-10-11 15:00 +0200, iseki wrote:
> Oh sorry, I should use [reply to all] instead of [reply]. I don't have much
> experience with mailing lists...
> 
> But why the mailing list haven't use the "Reply-To" header specify where to
> reply? Because the mail is you send to me directly?

The message author sets Reply-To, if necessary, according to RFC 5322.
Are there mailing lists that actually set this header?

-- 
Erik



Re: Questions about document "Concurrenry control" section

From
Tom Lane
Date:
Erik Wienhold <ewie@ewie.name> writes:
> On 2024-10-11 15:00 +0200, iseki wrote:
>> But why the mailing list haven't use the "Reply-To" header specify where to
>> reply? Because the mail is you send to me directly?

> The message author sets Reply-To, if necessary, according to RFC 5322.
> Are there mailing lists that actually set this header?

It's been done in the past, but current practice is strongly against
it.  For example, in your own message that I'm replying to, there's
a DKIM signature (RFC 6376):

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001;
    t=1728654419;
    h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
     to:to:cc:cc:mime-version:mime-version:content-type:content-type:
     in-reply-to:in-reply-to:references:references;
    bh=7w7CHebdKaXtlhCMxa/jNIcoEy1tFhZmzOD+dT7nP8k=;
    b=K3s//HzYXU+chTDeY5p/wGwd5eglESiaugVSpGWo49ryL9ajLdimYMD3uIc3rr8PglZizV
    nk2wDiMsHnLR0EAgKsGzNvtxt4N9hHxMk7UI3F4XOVYqnemk95YVRNpFpEFww833uUqA+9
    RPypj/ezsKbi2vBzzXIoZ+Tf3t6XfuZYf6poq1J+ud0X278yQMnA1XbZNsenQkCWoYPiXb
    yklxY2Nbp9NyiDHCDQ0KPYAT6/0ttzbprNhgSzhN7LND6ehUvLlsmKG3rwqby2LmFRwliQ
    RDZ4MAxEzZKfOr8HGnubQf8FdQPGw6jlAn3U8199c+3QcIAWJ99Wrtb5rQPdEw==

That lists "reply-to" as one of the signed header fields.  So if the
mailing list were to modify Reply-To (including inserting one where
there was none before) a DKIM-verifying recipient would regard the
message as a forgery.

            regards, tom lane



Re: Questions about document "Concurrenry control" section

From
iseki zero
Date:

So, should I use the [reply to all] button? I'm afraid the receipt list will growing to have too many address.

BTW, I'm using Thunderbird. If you have better software, tell me please.

Sorry for my poor English.

iseki zero.

在 2024/10/11 22:19, Tom Lane 写道:
Erik Wienhold <ewie@ewie.name> writes:
On 2024-10-11 15:00 +0200, iseki wrote:
But why the mailing list haven't use the "Reply-To" header specify where to
reply? Because the mail is you send to me directly?
The message author sets Reply-To, if necessary, according to RFC 5322.
Are there mailing lists that actually set this header?
It's been done in the past, but current practice is strongly against
it.  For example, in your own message that I'm replying to, there's
a DKIM signature (RFC 6376):

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001;	t=1728654419;	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:	 in-reply-to:in-reply-to:references:references;	bh=7w7CHebdKaXtlhCMxa/jNIcoEy1tFhZmzOD+dT7nP8k=;	b=K3s//HzYXU+chTDeY5p/wGwd5eglESiaugVSpGWo49ryL9ajLdimYMD3uIc3rr8PglZizV	nk2wDiMsHnLR0EAgKsGzNvtxt4N9hHxMk7UI3F4XOVYqnemk95YVRNpFpEFww833uUqA+9	RPypj/ezsKbi2vBzzXIoZ+Tf3t6XfuZYf6poq1J+ud0X278yQMnA1XbZNsenQkCWoYPiXb	yklxY2Nbp9NyiDHCDQ0KPYAT6/0ttzbprNhgSzhN7LND6ehUvLlsmKG3rwqby2LmFRwliQ	RDZ4MAxEzZKfOr8HGnubQf8FdQPGw6jlAn3U8199c+3QcIAWJ99Wrtb5rQPdEw==

That lists "reply-to" as one of the signed header fields.  So if the
mailing list were to modify Reply-To (including inserting one where
there was none before) a DKIM-verifying recipient would regard the
message as a forgery.
			regards, tom lane


Re: Questions about document "Concurrenry control" section

From
"David G. Johnston"
Date:
On Friday, October 11, 2024, iseki zero <admin@iseki.space> wrote:

So, should I use the [reply to all] button? I'm afraid the receipt list will growing to have too many address.


Yes, just use reply-all.  The to list only grows when people reply, and it is a mailing list - all these people are getting the email anyway…this just lets them filter on things they have replied to.

David J. 

Re: Questions about document "Concurrenry control" section

From
admin@iseki.space
Date:
I found. Maybe we should reply to the mailing list only. Otherwise we'll receive multiple copies of the emails.




Re: Questions about document "Concurrenry control" section

From
Adrian Klaver
Date:
On 10/11/24 20:10, admin@iseki.space wrote:
> I found. Maybe we should reply to the mailing list only. Otherwise we'll 
> receive multiple copies of the emails.
> 
> 

Not if you go here:

https://lists.postgresql.org/manage/

and check:

Don't receive an extra copy of mails when listed in To or CC fields

-- 
Adrian Klaver
adrian.klaver@aklaver.com




Re: Questions about document "Concurrenry control" section

From
Arbol One
Date:

Yes, this is IMOP, the best way.
I have set up Thunderbird to throw everything that is not in my contact list to Trash, thus your email will never be read by me if you don't use - Reply to Mailing list -. Just saying.

On 2024-10-11 11:10 p.m., admin@iseki.space wrote:
I found. Maybe we should reply to the mailing list only. Otherwise we'll receive multiple copies of the emails.



--
ArbolOne ™
Using Fire Fox and Thunderbird.
ArbolOne is composed of students and volunteers dedicated to providing free services to charitable organizations.
ArbolOne's development on Java, PostgreSQL, HTML and Jakarta EE is in progress [ í ]

Re: Questions about document "Concurrenry control" section

From
Adrian Klaver
Date:
On 10/12/24 03:17, Peter J. Holzer wrote:
> On 2024-10-11 21:21:16 -0700, Adrian Klaver wrote:
>> On 10/11/24 20:10, admin@iseki.space wrote:
>>> I found. Maybe we should reply to the mailing list only. Otherwise we'll
>>> receive multiple copies of the emails.
>>>
>>>
>>
>> Not if you go here:
>>
>> https://lists.postgresql.org/manage/
>>
>> and check:
>>
>> Don't receive an extra copy of mails when listed in To or CC fields
> 
> Yes, but that's the wrong way around. Then I get some mails only
> directly and some only through the list, which makes proper filtering
> hard to impossible. For me it's much better to get all the mails through
> the list (so I can use the List-ID header to filter them into the
> appropriate folder) and live with the extra copies in my inbox. I would
> prefer to not get those extra copies, but there is nothing the list can
> do about them, that's under the control of the sender.

Not following. If it goes through the list either by 'Reply to list' or 
Reply All' it is going to pick up the List-ID and be filtered. All the 
setting does is make sure you don't get extra copies when your email is 
in the To or CC fields, which is the list doing something about them. 
I've been using this for years and aside from some general list/email 
issues it has worked as advertised.


> 
>          hp
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com