LLT V11.docx
- 文档编号:7038672
- 上传时间:2023-01-16
- 格式:DOCX
- 页数:8
- 大小:56.86KB
LLT V11.docx
《LLT V11.docx》由会员分享,可在线阅读,更多相关《LLT V11.docx(8页珍藏版)》请在冰豆网上搜索。
LLTV11
(Thispageisreservedforcoverpage)
Introduction1
EnhanceTechnology2
Sagas2
AltruisticLocking2
ApplicationDevelopment5
1.ConTracts5
3.Workflowcomputing6
4.Connectingactivitiesbymessaging6
Work-flowandTask-graph9
Conclusions10
Reference:
11
Introduction
ALong-livedtransaction(LLT)isatransactionthatholdstheresourceofthedatabaseforalongperiodoftimesuchashoursordays.Ithasalongdurationcomparedtoothertransactionsbecauseofaccessingmanydatabaseobjects,computingalongoperationofdatabaseandwaitingforuser’sinput.
Inmostcases,LLTpresentsaseriousproblemoftheperformanceintransactionprocess.Whenitlocksthewholedatabasebeforerunningthetransaction,noothertransactioncanrun.Asaresult,itholdsalotofresourcesfortoolong,delaystheterminationofashorterandcommontransactionsanddecreasesoverallthroughput.Also,LLTincreasesthefrequencyofsystemdeadlockandresultsahigherprobabilityintransactionfailures.Similarly,italsocreateschallengesofconcurrencycontrolandscalability.Forsolvingtheseproblems,therearetwostrategiesintroducedtoalleviateit.OneapproachistocutLLTintoalotofshortsub-transactionssothattheydon’tholdthatmanyresources.AnotherapproachistorequestLLTtodonatetheresourcesinordertoavoidtheresourcesbeingheldtoolong.
IntermsofcuttingLLTintoshortsub-transactions,oneapproachisSagas[1]thatreferstoaLLTthatcanbebrokenupintoacollectionofsub-transactionsthatcanbeinterleavedinanywaywithothertransactions.ToimplementtheSagas,theSagasmanagementsystemisrequiredandsomefunctionsarerequired.TheyareusedtoinformthesystemforrunningSaga.InRecoverystrategy,Sagausesbackwardrecoveryandforwardrecoveryforsolvingthesystemcrashed.
Intermsofdonatingtheresources,oneapproachisAltruisticlocking[2]thatisanextensiontoTwoPhaseLocking(2PL).ItprovidesaDonateoperationforconcurrencycontrolandallowsLLTtoreleasetheresourcesearly.Donateisusedtoinformtheschedulerthataccesstoanobjectisnolongerrequiredbythelockingtransaction.OthertransactionsthataccessthereleaseddataarecalledtoruninthewakeoftheLLTandspeciallockingrulesmustbefollowed.Altruisticlockingiseasytoimplementandguaranteesserializability.
EnhanceTechnology
Sagas
AsagareferstoaLLTthatisbrokenupintoacollectofsub-transactionssothatitcanbeinterleavedinanywaywithothertransactions.Eachsub-transactioninthiscaseisarealtransactioninthesensethatitpreservesdatabaseconsistency.Asagaislikeanestedtransactionexceptthatitonlypermitstwolevelsofnestingthetoplevelsagaandsimpletransactionsandtheouterlevelfullatomicityisnotproved,sosagasmayviewthepartialresultsofothersagas.
Intheimplementationofasagaprocessingmechanism,therearesomeapproachesthatareuserfacilities,codereliablyandrecovery.Theyareshownasfollows:
-
Inuserfacilities,whenanapplicationprogramwishestoinitiateasaga.Itissuesabegan-sagacommandtothesystemthatisfollowedbyaseriesofbegin-transaction,end-transactioncommandsthatindicatetheboundariesofeachtransaction.Inaddition,anabort-transactioncommandcanbeusedforterminatingthecurrenttransaction,butnotthesaga.Similarly,anabort-sagacommandisusedtoabortfirstthecurrentlyexecutingtransactionandsecondtheentiresaga(byrunningcompensatingtransactions).Finally,anend-sagacommandisusedtocommitthecurrentlyexecutingtransactionandtocompletethesaga.
Incodereliably,themissingtransactionsorthecompensatingtransactionsareneededtoabortthesagaforcompletingarunningsagaafteracrash.Theapplicationcodeisrequiredforsagasbedefinedandupdatedinthesamefashion.Inrecovery,whenafailureinterruptsasaga,therearetwochoicescompensatefortheexecutedtransactionsthattheyarebackwardrecoveryandforwardrecovery.Forbackwardrecovery,thesystemneedscompensatingtransactions,forforwardrecovery,thesystemneedssave-points.
AltruisticLocking
AltruisticLockingwasoriginallypresentedinSalemetal.anditisamodificationtoTwoPhaseLocking(2PL)thatseveraltransactionsmayholdlocksonanobjectsimultaneouslyundercertainconditions.AltruisticlockingprovidesaDonateoperationforconcurrencycontrol.Donateisusedtoinformtheschedulerthataccesstoanobjectisnolongerrequiredbythelockingtransaction.WhenDonateisused,thedonatingtransactionfreelycontinuestoacquirenewlocksbecauseDonateandLockoperationsneednotbetwo-phase.
Donateoperationsarebeneficialbecausetheymaypermitothertransactionstolockthedonatedobjectbeforeitisunlocked.Analtruisticschedulershouldnotallowarbitraryaccesstoanobjectthathasbeendonatedbutnotunlocked.TherearetworulesforgoverningtheDonationoperationshownasfollows:
Rule1:
Twotransactionscannotholdconflictinglocksonthesameobjectsimultaneouslyuntiloneofthetransactionsdonatestheobjectfirst.
Rule2:
IfatransactionT1locksanobjectthathasdonatedbyanothertransactionT2,itcanbecalledinthewakeofthedonatingtransaction.WhenatransactionT1isinthewakeofanothertransactionT2andthenitmustbecompletelyinthewakeofT1untilT2performsitsfirstUnlockoperation.
Thealtruisticlockingrules(1and2)guaranteethatcommittedtransactionsareserialized,buttheydonotguaranteethattransactionswillbefailure-atomic.Toavoidthisproblem,strictaltruisticlockingthattheappropriaterestrictionisthatwritelockscanneitherbedonatednorunlockeduntilthelockingtransactionhascommitted.Altruisticlockingschedulersproduceastrictandserializableschedule.Togetherwithappropriaterecoveryfacilitiessuchasloggingandcheckpointing,strictaltruisticlockingguaranteesfullyatomictransactionexecution.However,itdoesnotbeverybeneficialwhenlong-livedtransactionsconsistprimarilyofupdateoperations.However,itmayprovideidealapproachwhenalongtransactionconsistsprimarilyofreadoperationwithafewupdates.Therearethreealternativestoaltruisticlockingshownasfollows:
-
●Onealternativeistouseregularlocking,butdelaythecommitofindebtedtransactionsuntilthedonatingtransaction(s)hascommitted.Althoughthissolutionmayallowmoretransactionconcurrency,itmaystillresultinlengthycommitdelays.Furthermore,itintroducescascadingrollbacks,sinceanabortofonetransactionmaynecessitatetheabortsofothers.
●Anotheralternativeistoimplementsave-pointswithintransactionsthatcreatewakes.Whensuchatransactionpassesasave-point,updatesithasmadesofararecommitted;afutureabortofthetransactionwillonlyrollbackupdatesmadeafterthemostrecentsave-point.Writelocksbehindsave-pointscanbedonatedwithoutfearofcascadingrollbacks.Adrawbackofthistechniqueisthatitcompromisesthefailureatomicityofthetransactioncontainingthesave-points.Afterasavepointatransactioncannotissueaself-abortcommandtorollbacktheentiretransaction.
●Afinalalternativeistoimplementatypeof“conditional”donationofupdatedobjects.Suchconditionaldonationswouldpermitothertransactionstowritethedonatedobjects,butnottoreadthem.Thistechniqueintegratesthenotionofrecoverabilitywithaltruisticlocking.Unfortunately,itisnotacompletesolutiontotheproblemoffailureatomicity.Inaread/writedatabase,onlytransactionsthatperform“blindwritesondonatedobjectscanbenefitfromit.
Intransactionconcurrency,severaltypesofnon-lockingconcurrencycontrolshavealsobeendeveloped.Inparticular,thosebasedonserializationgraphtesting(SGT)canscheduleanyserializablehistory.Despitethisadvantage,lockingprotocolsaremorefrequentlyused.ThismaybebecauselockingprotocolsaresimplertoimplementandmoreefficientthanSGT,whichinvolvesgraphtraversaleachtimeatransactionattemptstocommit.
Locking-basedprotocolsmustperformsomeformofdeadlockdetectionorprevention,whichmayinvolvetraversingawaits-forgraph.However,thewaits-forgraphmustbecheckedmuchlessfrequentlythanaserializationgraph.Inparticular,checksarenotrequiredateachtransaction’scommitpoint.SGTprotocolsmaybeparticularlyinefficientfordistributedschedulersinwhichtheserializationgraphmaybedistributedacrossmultiplesites.
Concurrencycontrolsbasedontimestampordering(TO)havealsobeendeveloped.Unfortunately,TOisnotwellsuitedtolong-livedtransactions.Sincelongtransactionswilltendtohaverelativelyoldtimestamps,theyarepronetoabortbecauseofconflictswithnewtransactionswithlargetimestamps.
Forimprovingthetransactionconcurrency,EnlargingaWakeandAutomaticWakeExpansionareused.InEnlargingaWake,atransactioncanincreasethesizeofitswakeandthenmoretransactionsruninthewakethatcanavoidblocking.InAutomaticWakeExpansion,TheMarkoperationoperatesonasingledatabaseobjectanditprovidestheschedulerwiththenecessaryinformation.Transactionsthatcreatewakesinformtheschedulerwhichdatabaseobjectstheyrequireaccessto.
ApplicationDevelopment
InadditiontocuttingtheLLTintoshortsub-transactionsanddonatingtheresources,therearesomeapproachesimplementedformanagingLLT.TheyareConTracts,Implementingadvancedtransactionsmodelswithobjects,Workflowcomputing,ConnectingactivitiesbymessagingandAgent-orientedModelbasedonWork-flowandTask-graph
1.ConTracts[5]
AConTractisatwo-leveltransac
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- LLT V11