Re: Autonomous Transaction (WIP)
От | Rajeev rastogi |
---|---|
Тема | Re: Autonomous Transaction (WIP) |
Дата | |
Msg-id | BF2827DCCE55594C8D7A8F7FFD3AB7713DDE04A7@SZXEML508-MBX.china.huawei.com обсуждение исходный текст |
Ответ на | Autonomous Transaction (WIP) (Rajeev rastogi <rajeev.rastogi@huawei.com>) |
Список | pgsql-hackers |
<div class="WordSection1"><p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt">On <span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">10 April 2014 11:18, Pavan Deolasee Wrote:</span> <p class="MsoNormal"style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">>>I could think of few global variableslike transaction properties related(i.e. read-only mode, isolation level etc). As I plan to keep transaction propertiesof autonomous transaction same as main transaction, so there is no need to have these global variables separately.<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">>>Apart from this thereare global variables like with-in transaction counters, GUC, xactStartTimeStamp. I think there is no need to maintainthese variables also separately. They can continue from previous value for autonomous transaction also similar toas sub->>transaction does. <p class="MsoNormal"> <p class="MsoNormal">>Hmm. Is that in line with what other databasesdo ? I would have preferred AT to run like a standalone transaction without any influence of the starting transaction,managing its own resources/locks/visibility/triggers etc.<p class="MsoNormal"> <p class="MsoNormal">To me itseems it is not very useful to keep the transaction properties separate except the read-only properties (though oracledoes not share any transaction properties).<p class="MsoNormal"> <p class="MsoNormal">So we can have restriction thatisolation and deferrable properties of main transaction will be inherited by autonomous transaction but read-only propertiescan be defined independently by autonomous transaction. Which looks to be fair restriction according to me.<p class="MsoNormal"> <pclass="MsoNormal">In order to keep read-only properties separate, there is already infrastructure inPG. Inside the structure TransactionStateData, there is variable prevXactReadOnly (entry-time xact r/o state), which cankeep the parent transaction read only properties and XactReadOnly can be changed to current transaction properties.<pclass="MsoNormal"> Moreover we can take this (transaction properties) as a featureenhancement also once a basic infrastructure is established, if acceptable to everyone.<p class="MsoNormal"> <p class="MsoNormal">Autonomoustransaction will not share resource/lock/visibility etc with main transaction. This has beenalready taken care in WIP patch.<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">>>In-caseof autonomous transaction, only specific globalvariables initialized are related to resources (similar to sub-transaction), which anyway gets stored in current transactionstate.<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">>>Please let me knowif I am missing something or if you have some specific global variables related issue.<p class="MsoNormal">>No, Idon't have any specific issues in mind. Mostly all such global state is managed through various AtStart/AtEOX and relatedroutines. So a careful examination of all those routines will give a good idea what needs to be handled. You probablywill require to write <p class="MsoNormal">>AtATStart/AtATEOX and similar routines to manage the state at AT start/commit/rollback.Sorry, I haven't looked at your WIP patch yet.<p class="MsoNormal"> <p class="MsoNormal">For some ofthe resources, I have already written AtATStart/AtATEOX kind of routines in WIP patch.<p class="MsoNormal"> <p class="MsoNormal">Comments/feedbacks/doubtsare welcome. <p class="MsoNormal"> <p class="MsoNormal"><i><span style="color:black">Thanksand Regards,</span></i><p class="MsoNormal"><i>Kumar Rajeev Rastogi<span style="color:black"> </span></i><pclass="MsoNormal"> <p class="MsoNormal"> </div>
В списке pgsql-hackers по дате отправления:
Следующее
От: Gregory SmithДата:
Сообщение: Re: WIP patch (v2) for updatable security barrier views