LLT V11.docx

上传人:b****6 文档编号:7038672 上传时间:2023-01-16 格式:DOCX 页数:8 大小:56.86KB
下载 相关 举报
LLT V11.docx_第1页
第1页 / 共8页
LLT V11.docx_第2页
第2页 / 共8页
LLT V11.docx_第3页
第3页 / 共8页
LLT V11.docx_第4页
第4页 / 共8页
LLT V11.docx_第5页
第5页 / 共8页
点击查看更多>>
下载资源
资源描述

LLT V11.docx

《LLT V11.docx》由会员分享,可在线阅读,更多相关《LLT V11.docx(8页珍藏版)》请在冰豆网上搜索。

LLT V11.docx

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

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 工作范文 > 行政公文

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1