11.07.2015 Views

Tutorial on Fault Tolerant CORBA

Tutorial on Fault Tolerant CORBA

Tutorial on Fault Tolerant CORBA

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong><strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong>Download specificati<strong>on</strong>s fromhttp://www.omg.org/cgi-bin/doc?ptc/2000-03-04http://www.omg.org/cgi-bin/doc?ptc/2000-03-05Download tutorial fromhttp://www.omg.org/cgi-bin/doc?orbos/2000-09-14OMG MeetingBurlingame, CA September 2000<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Outline1. Introducti<strong>on</strong> to <strong>Fault</strong> Tolerance2. <strong>Fault</strong> Tolerance Mechanisms3. <strong>Fault</strong> Tolerance Properties4. <strong>Fault</strong> Tolerance Management5. <strong>Fault</strong> <strong>Tolerant</strong> Applicati<strong>on</strong>s6. <strong>Fault</strong> <strong>Tolerant</strong> Hello Server Example<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Outline1. Introducti<strong>on</strong> to <strong>Fault</strong> Tolerancea. Objectivesb. Limitati<strong>on</strong>sc. Types of <strong>Fault</strong>sd. Basic C<strong>on</strong>cepts<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


What is <strong>Fault</strong> Tolerance?• Murphy’s Law of <strong>Fault</strong> Tolerance:– The <strong>on</strong>ly thing that is certain is thatthe system is going to fail• The best that we can dois to reduce the probability of failure(but not to zero)<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Objectives of FT <strong>CORBA</strong>• Wide range of fault tolerance– Simple low-cost clients– Highly reliable server clusters– Many systems will c<strong>on</strong>tain both– Other systems will c<strong>on</strong>tain external clients thatknow nothing, or little, about fault tolerance• Local Clusters and alsoWide-area Systems• Large-scale Servers and alsoEmbedded C<strong>on</strong>trollers<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Limitati<strong>on</strong>s of the Specificati<strong>on</strong>• Interoperability limitati<strong>on</strong>s– All replicas of an object must be hosted byinfrastructure from the same vendor• N<strong>on</strong>-determinism may compromisestr<strong>on</strong>g replica c<strong>on</strong>sistency• No support for partiti<strong>on</strong>ed systems• No commissi<strong>on</strong> (wr<strong>on</strong>g result) faults• No software design faults• Vendors can provide proprietary productsthat overcome these limitati<strong>on</strong>s<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Types of <strong>Fault</strong>s• Processor faults– Crash faults– Commissi<strong>on</strong> faults (very expensive)• Network faults– Multiple network c<strong>on</strong>necti<strong>on</strong>s• Operating System hangs• Memory leaks• Software design errors(bey<strong>on</strong>d the state-of-the-art)<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


C<strong>on</strong>sistency• Redundancy is the basis of fault tolerance• The <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> standard is based <strong>on</strong>fault tolerance by object replicati<strong>on</strong>• Str<strong>on</strong>g replica c<strong>on</strong>sistency– All of the replicas have the same state– Greatly simplifies the applicati<strong>on</strong> system design– Requires careful design of, and str<strong>on</strong>g mechanisms in,the infrastructure<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Object Groups• Replicas of an object form an object group• Each object group has an InteroperableObject Group Reference (IOGR)• Object group abstracti<strong>on</strong> provides– Replicati<strong>on</strong> transparency– Failure transparency<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Identity Model• <strong>CORBA</strong> supports a weak identity model• <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> requiresa str<strong>on</strong>g identity model• Object groups identified by– FTDomainId, ObjectGroupId• Members of object groups identified by– FTDomainId, ObjectGroupId, Locati<strong>on</strong><str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Replicati<strong>on</strong> Styles• Passive Replicati<strong>on</strong>– Only <strong>on</strong>e replica processes each requestOther replicas are available as backups if required– Lower memory and processing costs slowerrecovery from faults• Active Replicati<strong>on</strong>– Several replicas process each request– Fastest recovery from faults• Underlying mechanisms are the same for both<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Who Has C<strong>on</strong>trol?• Infrastructure-c<strong>on</strong>trolled fault tolerance– Automatic creati<strong>on</strong> and allocati<strong>on</strong> of replicas– Automatic maintenance of replica c<strong>on</strong>sistency– More sensible for complex programs <strong>on</strong> servers• Applicati<strong>on</strong>-c<strong>on</strong>trolled fault tolerance– Precise c<strong>on</strong>trol over object creati<strong>on</strong> and allocati<strong>on</strong>– Applicati<strong>on</strong> algorithms maintain replica c<strong>on</strong>sistency– May be necessary for embedded systems<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


<strong>Fault</strong> Tolerance for the Client• Failover– If Server does not resp<strong>on</strong>d, Client should tryagain using the same or an alternate address– If Client transmits its request more than <strong>on</strong>ce,it should not be executed more than <strong>on</strong>ce• Addressing– If Client uses an obsolete address, Servershould supply an up to date address• Loss of C<strong>on</strong>necti<strong>on</strong>– If Client’s c<strong>on</strong>necti<strong>on</strong> to Server fails,the Client’s ORB should be informed prompty<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


<strong>Fault</strong> Tolerance for the Server• Object Replicati<strong>on</strong>• Object Group Properties– Property Manager interface• Creating <strong>Fault</strong>-tolerant Objects– Generic Factory interface– Object Group Manager interface• Detecting <strong>Fault</strong>s• State Transfers<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


<strong>Fault</strong> Tolerance Domains• Aid applicati<strong>on</strong> management and provide forscalability• Each <strong>Fault</strong> Tolerance Domain is managed by asingle Replicati<strong>on</strong> ManagerHawaiiLocati<strong>on</strong>A1Host 1IIOPMessageover TCP/IPORBwithoutsupport for<strong>Fault</strong> ToleranceHost 2GatewayB1San JoseDomainHost 3B2D1C1C2Host 4Wide AreaDomainHost 5C3E1E2E3F1Host 7Host 6Bost<strong>on</strong>DomainF2<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


set_properties()create_object()Architectural OverviewReplicati<strong>on</strong>Managernotificati<strong>on</strong>s<strong>Fault</strong>Notifier<strong>Fault</strong>Detectorcreate_object()fault reportsis_alive()ClientServerServerCS1S2Factory<strong>Fault</strong>DetectorFactory<strong>Fault</strong>Detector<strong>CORBA</strong> ORB <strong>CORBA</strong> ORB <strong>CORBA</strong> ORBLoggingMechanismRecoveryMechanismLoggingMechanismRecoveryMechanismLoggingMechanism<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Outlineâ2. <strong>Fault</strong> Tolerance Mechanismsa. Addressingb. Failover<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Interoperable Object Group Reference(IOGR)• An IOGR is a multiple profile IOR• Each profile c<strong>on</strong>tains a TAG_GROUPcomp<strong>on</strong>ent, c<strong>on</strong>sisting of– FTDomainId– ObjectGroupId– ObjectGroupRefVersi<strong>on</strong>• At most <strong>on</strong>e profile may c<strong>on</strong>tain aTAG_PRIMARY comp<strong>on</strong>ent, which gives a hintas to which profile corresp<strong>on</strong>ds to the primary<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Interoperable Object Group ReferenceType_idNumber ofProfilesIIOP ProfileIIOP ProfileIIOP ProfileMultipleComp<strong>on</strong>ents ProfileTAG_INTERNET_IOPProfileBodyIIOPVersi<strong>on</strong> Host PortObjectKeyComp<strong>on</strong>entsNumber ofComp<strong>on</strong>entsTAG_GROUPComp<strong>on</strong>entTAG_PRIMARYComp<strong>on</strong>entOtherComp<strong>on</strong>entstag_group_versi<strong>on</strong>ft_domain_idobject_group_idobject_group_versi<strong>on</strong><str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Profiles AddressObject Group MembersInteroperable Object Group ReferenceProfile S1 Profile S2 Profile S3ServerReplicaS1ServerReplicaS2ServerReplicaS3<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Access via IIOPDirectly to PrimaryInteroperable Object Group ReferenceProfile S1 Profile S2 Profile S3ServerReplicaS1ClientIIOPmessageServerReplicaS2ServerReplicaS3<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Profiles Address GatewaysInteroperable Object Group ReferenceProfile G1 Profile G2GatewayG1GatewayG2ServerReplicaS1ServerReplicaS2ServerReplicaS3<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Access via IIOP and a GatewayInteroperable Object Group ReferenceProfile G1 Profile G2ClientIIOPmessageGatewayG1GatewayG2ProprietarymulticastprotocolServerReplicaS1ServerReplicaS2ServerReplicaS3<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Direct Access viaProprietary Multicast ProtocolInteroperable Object Group ReferenceProfile G1 Profile G2ProprietarymulticastprotocolServerReplicaS1GatewayG1ClientServerReplicaS2GatewayG2ServerReplicaS3<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Most Recent Object Group Reference• ProblemObject Group Reference may not corresp<strong>on</strong>d tocurrent membership of the server object group• Soluti<strong>on</strong>GROUP_VERSION Service C<strong>on</strong>textTAG_GROUP comp<strong>on</strong>ent of IOGR c<strong>on</strong>tainsGroup Versi<strong>on</strong> Number (GVN) for theserver object groupClient ORB puts GVN in the GROUP_VERSIONService C<strong>on</strong>text of the client’s request messagefor the server object group<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Most Recent Object Group Reference• Server ORB extracts the GVN from therequest message• If server GVN = GVN from client– Primary: Process request– Backup: Log request• If server GVN > GVN from client– Throw LOCATE_FORWARD_PERM with IOGR• If server GVN < GVN from client– Get new IOGR from Replicati<strong>on</strong>Manager<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Outlineâ2. <strong>Fault</strong> Tolerance Mechanismsa. Addressingb. Failover<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Failover Semanticswith <strong>Fault</strong> TolerancePermitted Failover C<strong>on</strong>diti<strong>on</strong>sCompleti<strong>on</strong> StatusCOMPLETED_NOCOMPLETED_MAYBE<strong>CORBA</strong> Excepti<strong>on</strong>COMM_FAILURETRANSIENTNO_RESPONSEOBJ_ADAPTER<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Transparent Reinvocati<strong>on</strong>• ProblemWith reinvocati<strong>on</strong> for COMPLETED_MAYBE,at-most-<strong>on</strong>ce semantics might be violatedif no extra mechanisms are in place• Soluti<strong>on</strong>REQUEST Service C<strong>on</strong>text– Client Id– Retenti<strong>on</strong> Id– Expirati<strong>on</strong> TimeAllows server ORB to recognize that a request isa repetiti<strong>on</strong> of a previous requestIf it is, server does not reexecute the request butreturns the reply that was previously generated<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Transport Heartbeats• Problem– Host or c<strong>on</strong>necti<strong>on</strong> fails during clientinvocati<strong>on</strong>– TCP/IP c<strong>on</strong>necti<strong>on</strong> not cleanly torn downand Client ORB hangs <strong>on</strong> the c<strong>on</strong>necti<strong>on</strong>• Soluti<strong>on</strong>– Periodic heartbeat messages over thec<strong>on</strong>necti<strong>on</strong><str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Transport HeartbeatsClient Side• HeartbeatPolicy– Heartbeat – On/Off– Heartbeat Interval– Heartbeat Timeout• If profile hasTAG_HEARTBEAT_ENABLED set to true,– Client can setHeartbeatPolicy values– Client ORB invokes_FT_HB() <strong>on</strong> serverServer Side• TAG_HEARTBEAT_ENABLED comp<strong>on</strong>entin profile• HeartbeatEnabledPolicyallows server to turnheartbeats <strong>on</strong> and off• Server ORB resp<strong>on</strong>dsto _FT_HB()<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Outline3. <strong>Fault</strong> Tolerance Propertiesa. Replicati<strong>on</strong> Styleb. Membership Stylec. C<strong>on</strong>sistency Styled. <strong>Fault</strong> M<strong>on</strong>itoring Stylee. <strong>Fault</strong> M<strong>on</strong>itoring Granularityf. Factoriesg. Initial Number of Replicash. Minimum Number of ReplicasI. <strong>Fault</strong> M<strong>on</strong>itoring Interval and Timeoutj. Checkpoint Interval<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Replicati<strong>on</strong> Style• Stateless– Read-<strong>on</strong>ly access to static data• Cold passive replicati<strong>on</strong>– Recovery from faults using state informati<strong>on</strong> andmessages recorded in a message log– Slowest recovery from faults• Warm passive replicati<strong>on</strong>– Current state of the "primary" replica is transferredperiodically to the "backup" replicas– More rapid recovery from faults• Active replicati<strong>on</strong>– Every replica executes the invoked methods– Very rapid fault recovery<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Active Replicati<strong>on</strong>Clientinvokes a method ofServer AServer AObject ObjectObject Object ObjectEternalEternalEternal Eternal EternalReliable totally ordered multicastServer BEternal Eternal EternalSTOPObject Object ObjectSTOPDuplicate repliessuppressedSTOPSTOPDuplicate invocati<strong>on</strong>ssuppressedReliabletotally orderedmulticasts forrequests and replies<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Passive Replicati<strong>on</strong>Clientinvokes a method ofServer AEternalEternalPrimaryreplicaServer AObject ObjectObject Object ObjectOnly primary replicaof Server Aexecutes the methodEternal Eternal EternalReliable totally ordered multicastServer BObject Object ObjectEternal Eternal EternalPrimaryreplicaOnly primary replicaof Server Bexecutes the methodReliabletotally orderedmulticastfor state transferReply returnedfrom primary replica of Server Bto primary replica of Server A<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Membership Style• Infrastructure-C<strong>on</strong>trolled– <strong>Fault</strong> Tolerance Infrastructure creates multiplereplicas of an object (members of an object group)and allocates them to appropriate hosts• Applicati<strong>on</strong>-C<strong>on</strong>trolled– The applicati<strong>on</strong> determines when and how manyreplicas to create and the hosts <strong>on</strong> which theyshould be created<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Infrastructure-C<strong>on</strong>trolledMembership StyleIOGRProfile Profilecreate_object()Applicati<strong>on</strong>Object AApplicati<strong>on</strong> directsReplicati<strong>on</strong> Manager tocreate an object groupReplicati<strong>on</strong> Managercreates and adds themembers to the groupReplicati<strong>on</strong>Managercreate_object()Host PObject BB1Host QObject BB2FactoryFactory<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Applicati<strong>on</strong>-C<strong>on</strong>trolledMembership StyleIOGRProfile Profilecreate_member()Applicati<strong>on</strong>Object AApplicati<strong>on</strong> directsthe Replicati<strong>on</strong> Managerto create a memberat a specific locati<strong>on</strong>and add it to the groupReplicati<strong>on</strong>Managercreate_object()Host PObject BB1Host QObject BB2Factory<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Applicati<strong>on</strong>-C<strong>on</strong>trolledMembership StyleIOGRProfile Profileadd_member()Applicati<strong>on</strong>Object AApplicati<strong>on</strong> createsa member and directsthe Replicati<strong>on</strong> Managerto add it to the groupReplicati<strong>on</strong>ManagerHost PObject BB1Host QObject BB2create_object()Factory<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


C<strong>on</strong>sistency Style• Infrastructure-C<strong>on</strong>trolled– <strong>Fault</strong> Tolerance Infrastructure maintainsstr<strong>on</strong>g replica c<strong>on</strong>sistency of the object replicasusing logging, checkpointing, activati<strong>on</strong>, andrecovery• Applicati<strong>on</strong>-C<strong>on</strong>trolled– The applicati<strong>on</strong> is resp<strong>on</strong>sible for maintainingwhatever c<strong>on</strong>sistency it requires, using its ownmechanisms– No logging, checkpointing, activati<strong>on</strong> or recoveryare provided by the <strong>Fault</strong> Tolerance Infrastructure<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Str<strong>on</strong>g Replica C<strong>on</strong>sistency• Maintained for object groups that have theInfrastructure-c<strong>on</strong>trolled C<strong>on</strong>sistency Style• For Active replicati<strong>on</strong>, at the end of eachoperati<strong>on</strong>, all of the members of theobject group have the same state• For Passive replicati<strong>on</strong>, at the end ofeach state transfer, all of the members ofthe object group have the same state<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


<strong>Fault</strong>M<strong>on</strong>itoringGranularityObject BObject AB1A1• Member• Locati<strong>on</strong>(proxy objectfor the locati<strong>on</strong>)• Locati<strong>on</strong> and Type(proxy objectof given typefor the locati<strong>on</strong>)Object BObject AB1A1Object BObject AB1A1<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Factories• Sequence of FactoryInfo– Factory that can be used to create amember of the object group– Locati<strong>on</strong> at which factory is to createa member of the object group– Criteria that the factory is to use whencreating the member of the object group,e.g. initializati<strong>on</strong> values, c<strong>on</strong>straints <strong>on</strong>the member, etc<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Outline4. <strong>Fault</strong> Tolerance Managementâa. Replicati<strong>on</strong> Managementb. <strong>Fault</strong> Managementc. Logging and Recovery Management<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Replicati<strong>on</strong> Management• Replicati<strong>on</strong> Manager maintainsobject groups (replicated objects)and fault tolerance propertiesof the object groups– Replicati<strong>on</strong> Style– Membership Style– C<strong>on</strong>sistency Style– etc<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Replicati<strong>on</strong> Management• Replicati<strong>on</strong> Manager interface providesmethods to register and obtain <strong>Fault</strong> Notifier– register_fault_notifier()– get_fault_notifier()• Replicati<strong>on</strong> Manager interface inherits from– Property Manager– Object Group Manager– Generic Factory<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Property Manager• <strong>Fault</strong> tolerance properties may be defined– For all replicated objects (object groups)– For all replicated objects of a type– For a specific replicated object at creati<strong>on</strong>– For executing replicated objects• More specific definiti<strong>on</strong>s override more generaldefiniti<strong>on</strong>s<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Property Manager Interface• set_default_properties()• get_default_properties()• remove_default_properties()• set_type_properties()• get_type_properties()• remove_type_properties()• set_properties_dynamically()• get_properties()<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Property Manager Interfacevoid set_type_properties(in TypeId type_id,in Properties overrides)raises(InvalidProperty, UnsupportedProperty);Properties get_type_properties(in TypeId type_id);void remove_type_properties(in TypeId type_id,in Properties props)raises(InvalidProperty, UnsupportedProperty);<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


When Can Properties Be Set?Replicati<strong>on</strong> StyleMembership StyleC<strong>on</strong>sistency Style<strong>Fault</strong> M<strong>on</strong>itoring Style<strong>Fault</strong> M<strong>on</strong>itoring GranularityFactoriesInitial Number of ReplicasMinimum Number of Replicas<strong>Fault</strong> M<strong>on</strong>itoring Interval andTimeoutCheckpoint IntervalDefault✔✔✔✔✔✔✔✔✔Type✔✔✔✔✔✔✔✔✔✔Creati<strong>on</strong>✔✔✔✔✔✔✔✔Dynamic✔✔✔✔✔<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Generic Factory Interface• Inherited by Replicati<strong>on</strong> Managerand invoked by applicati<strong>on</strong>to create or delete an object group• Implemented by Applicati<strong>on</strong> and invokedby Replicati<strong>on</strong> Manager or Applicati<strong>on</strong>to create or delete an individual object replica• create_object()• delete_object()<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Generic Factory Interfacetypedef Object ObjectGroup;typedef any FactoryCreati<strong>on</strong>Id;Object create_object(in TypeId type_id,in Criteria the_criteria,out FactoryCreati<strong>on</strong>Id factory_creati<strong>on</strong>_id)raises(NoFactory, ObjectNotCreated, InvalidCriteria,InvalidProperty, CannotMeetCriteria);void delete_object(in FactoryCreati<strong>on</strong>Id factory_creati<strong>on</strong>_id)raises(ObjectNotFound);<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


create_object()Generic FactoryReplicati<strong>on</strong>Managercreate_object()ServerS1ServerS2FactoryFactory<strong>CORBA</strong>ORB<strong>CORBA</strong>ORB<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Object Group Manager Interface• create_member()• add_member()• remove_member()• set_primary_member()• locati<strong>on</strong>s_of_members()• get_object_group_ref()• get_object_group_id()• get_member_ref()<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Object Group Manager InterfaceObjectGroup create_member(in ObjectGroup object_group,in Locati<strong>on</strong> the_locati<strong>on</strong>,in TypeId type_id,in Criteria the_criteria)raises(ObjectGroupNotFound, MemberAlreadyPresent,NoFactory, ObjectNotCreated, InvalidCriteria,...);ObjectGroup add_member(in ObjectGroup object_group,in Locati<strong>on</strong> the_locati<strong>on</strong>,in Object member)raises(ObjectGroupNotFound, MemberAlreadyPresent,ObjectNotAdded);<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


create_member()Object Group ManagerReplicati<strong>on</strong>Managercreate_object()ServerS1ServerS2Factory<strong>CORBA</strong>ORB<strong>CORBA</strong>ORB<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Outline4. <strong>Fault</strong> Tolerance Managementa. Replicati<strong>on</strong> Managementâ b. <strong>Fault</strong> Managementc. Logging and Recovery Management<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


<strong>Fault</strong> Management• <strong>Fault</strong> Detector– Part of Infrastructure– Supplier of fault reports to <strong>Fault</strong>Notifier• <strong>Fault</strong> Notifier– Receives fault reports from <strong>Fault</strong> Detectors and<strong>Fault</strong> Analyzer• <strong>Fault</strong> Analyzer– Specific to Applicati<strong>on</strong>– Both a c<strong>on</strong>sumer and a supplier of fault reports<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


<strong>Fault</strong> Detecti<strong>on</strong> & Notificati<strong>on</strong>Replicati<strong>on</strong>ManagerStructuredPushC<strong>on</strong>sumerSequencePushC<strong>on</strong>sumerpush_structured_event()push_sequence_event()<strong>Fault</strong>AnalyzerPullM<strong>on</strong>itorableis_alive()Applicati<strong>on</strong> Object<strong>Fault</strong>Detector<strong>Fault</strong>Notifierpush_structured_fault()push_sequence_fault()<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


<strong>Fault</strong> Event Propagati<strong>on</strong>• <strong>Fault</strong> Event Propagati<strong>on</strong>– CosNotificati<strong>on</strong>::StructuredEvent– CosNotificati<strong>on</strong>::EventBatch• Types of <strong>Fault</strong> Event– ObjectCrash<strong>Fault</strong>• If all objects ata Locati<strong>on</strong> failed,TypeId and ObjectGroupIddoes not exist• If all objects of a TypeIdat a Locati<strong>on</strong> failed,ObjectGroupId does not existDomain_name = FT_<strong>CORBA</strong>Type_name = ObjectCrash<strong>Fault</strong>FTDomainIdLocati<strong>on</strong>TypeIdObjectGroupIdmydomainmyhost/myprocessIDL:Bank:1.0<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 20001


<strong>Fault</strong> Event Suppliers & C<strong>on</strong>sumers• <strong>Fault</strong> Event Supplier– <strong>Fault</strong> Detector– Pushes fault events• <strong>Fault</strong> Event C<strong>on</strong>sumer– Replicati<strong>on</strong>Manager, C<strong>on</strong>sumer Object created byReplicati<strong>on</strong>Manager, or Applicati<strong>on</strong>– Registers using c<strong>on</strong>nect methods– Adds c<strong>on</strong>straints to filter fault events propagatedto it by the <strong>Fault</strong>Notifier<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


<strong>Fault</strong> Notifier Interface• Supplier End– push_sequence_fault()– push_structured_fault()• C<strong>on</strong>sumer End– c<strong>on</strong>nect_structured_fault_c<strong>on</strong>sumer()– c<strong>on</strong>nect_sequence_fault_c<strong>on</strong>sumer()– create_subscripti<strong>on</strong>_filter()– disc<strong>on</strong>nect_c<strong>on</strong>sumer()<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


<strong>Fault</strong> Notifier Interfacevoid push_structured_fault(in CosNotificati<strong>on</strong>::StructuredEvent event);void push_sequence_fault(in CosNotificati<strong>on</strong>::EventBatch events);<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


<strong>Fault</strong> Notifier Interfacetypedef unsigned l<strong>on</strong>g l<strong>on</strong>g C<strong>on</strong>sumerId;CosNotifyFilter::Filter create_subscripti<strong>on</strong>_filter(in string c<strong>on</strong>straint_grammer)raises(CosNotifyFilter::InvalidGrammer);C<strong>on</strong>sumerId c<strong>on</strong>nect_structured_fault_c<strong>on</strong>sumer(in CosNotifyComm::StructuredPushC<strong>on</strong>sumer c<strong>on</strong>sumer,in CosNotifyFilter::Filter filter);void push_structured_fault(in CosNotificati<strong>on</strong>::StructuredEvent event);<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Outline4. <strong>Fault</strong> Tolerance Managementa. Replicati<strong>on</strong> Managementb. <strong>Fault</strong> Managementc. Logging and Recovery Managementâ<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Logging & RecoveryManagementLogging for Active Replicati<strong>on</strong>ClientCServerS1ServerS2<strong>CORBA</strong> ORB <strong>CORBA</strong> ORB <strong>CORBA</strong> ORBLoggingMechanismRecoveryMechanismLoggingMechanismRecoveryMechanismLoggingMechanism<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Logging & RecoveryManagementLogging for Warm Passive Replicati<strong>on</strong>ClientCServerS1ServerS2<strong>CORBA</strong> ORB <strong>CORBA</strong> ORB <strong>CORBA</strong> ORBLoggingMechanismRecoveryMechanismLoggingMechanismRecoveryMechanismLoggingMechanism<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Logging & RecoveryManagementLogging for Cold Passive Replicati<strong>on</strong>ClientCServerS1ServerS2<strong>CORBA</strong> ORB <strong>CORBA</strong> ORB <strong>CORBA</strong> ORBLoggingMechanismRecoveryMechanismLoggingMechanismRecoveryMechanismLoggingMechanism<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


• get_state()• set_state()Checkpointable Interface• get_update()• set_update()Updateable Interface<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Logging & RecoveryManagementState Transfer for Cold Passive Replicati<strong>on</strong>ServerS1ServerS2get_state()<strong>CORBA</strong>ORB<strong>CORBA</strong>ORBRecoveryMechanismLoggingMechanismRecoveryMechanismLoggingMechanism<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Logging & RecoveryManagementRecovery for Cold Passive Replicati<strong>on</strong>ServerS1ServerS2set_state()<strong>CORBA</strong>ORB<strong>CORBA</strong>ORBRecoveryMechanismLoggingMechanismRecoveryMechanismLoggingMechanism<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Outline5. <strong>Fault</strong> <strong>Tolerant</strong> Applicati<strong>on</strong>sa. Pool of Processorsb. Internet Serverc. Telco Switching<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Pool of Processors• Multiple replicas of each applicati<strong>on</strong> object• The replicas of an applicati<strong>on</strong> object areassigned to different processors• No need for all objects to have the samenumber of replicas, or the same typeof replicati<strong>on</strong>• Replicati<strong>on</strong> Manager is replicatedjust like any other object<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Pool of ProcessorsThe replicas of an applicati<strong>on</strong> object areassigned to different processorsReplicati<strong>on</strong>ManagerObj DObj EReplicati<strong>on</strong>ManagerReplicati<strong>on</strong>ManagerObj CObj EObj AObj CObj BObj AObj BObj FObj A Obj C Obj CObj H Obj DObj FObj G Obj BObj EObj H Obj G Obj F<strong>Fault</strong><strong>Tolerant</strong>ORB<strong>Fault</strong><strong>Tolerant</strong>ORB<strong>Fault</strong><strong>Tolerant</strong>ORB<strong>Fault</strong><strong>Tolerant</strong>ORB<strong>Fault</strong><strong>Tolerant</strong>ORB<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Internet Server• Use pool of processors• Most clients will be outside our system andwill not understand fault tolerance• They communicate using IIOP/TCP/IP andenter the FT Domain through a gateway• If a gateway fails, the clients can failover toanother gateway<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Internet ServerInternetHost1Host2Host3UnreplicatedClientsGatewayGatewayGateway<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Internet Server• Must also provide back-end databaseto record inventory, orders, etc.• Do not attempt to replicate a database• Use a COTS fault-tolerant database• Access the database through a gateway• The gateway ensures that– The database is accessed <strong>on</strong>ce <strong>on</strong>ly– Replies from the database are multicastto all replicas<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Internet ServerInternetHost1Host2Host3UnreplicatedClientsGatewayGatewayGatewayGatewayGatewayCOTSDatabase<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Simple Switching Applicati<strong>on</strong>• Line cards plugged into dual-bus backplaneEach card has embedded processor with ORB• Each line card is distinct; they are not replicas• Two c<strong>on</strong>trol processors use active replicati<strong>on</strong>• Either c<strong>on</strong>trol processor can c<strong>on</strong>trol the switchThey are true replicas• Line cards communicate with bothc<strong>on</strong>trol processors<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Simple Switching Applicati<strong>on</strong>Replicated C<strong>on</strong>trol Computersuse embedded fault tolerancewith active replicati<strong>on</strong>ORBwith faulttoleranceGatewayUnreplicated computers <strong>on</strong> cardsuse client fault toleranceORB withclient faulttoleranceBackplane with dual bus interc<strong>on</strong>nect<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Larger Switching Applicati<strong>on</strong>Switchc<strong>on</strong>trollercardsShelf c<strong>on</strong>troller cardsLine cardsRedundantintershelfinterc<strong>on</strong>nectShelf c<strong>on</strong>troller cardsLine cardsShelf c<strong>on</strong>troller cardsLine cards<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Larger Switching Applicati<strong>on</strong>Switch c<strong>on</strong>trol functi<strong>on</strong>is shared betweenshelf c<strong>on</strong>trol processorsShelf c<strong>on</strong>troller cardsLine cardsRedundantintershelfinterc<strong>on</strong>nectShelf c<strong>on</strong>troller cardsLine cardsShelf c<strong>on</strong>troller cardsLine cards<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Outline6. <strong>Fault</strong>-<strong>Tolerant</strong> Hello Server Examplea. Hello Server Launcherb. Hello Server Factoryc. Hello Serverd. Hello Client<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server ExampleHelloServerLauncherPublishHello Serverobject groupreferenceReturnHello Serverobject groupreferenceObtainHello Serverreferenceset_type_properties()create_object()Replicati<strong>on</strong>ManagerHelloClientInvokeHelloServerInvokecreate_object()ReturnHello ServerreplicareferencesHelloServerHelloServer HelloFactoryCreateHello Serverobject<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server Launcher1. Initialize the ORB2. Obtain a reference to the Replicati<strong>on</strong> Manager3. Narrow the reference to the Property Manager4. Invoke the set_type_properties() method of theProperty Manager to set the propertiesfor the Hello Server type5. Narrow the reference to the Generic Factory6. Invoke the create_object() method of theGeneric Factory to create a Hello Serverreplicated object7. Publish the Hello Server's IOGR in a filefor the client to read<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server LauncherHelloServerLauncherPublishHello Serverobject groupreferenceReturnHello Serverobject groupreferenceObtainHello ServerreferenceInvokeset_type_properties()create_object()Replicati<strong>on</strong>ManagerHelloClientInvokehello()Invokecreate_object()ReturnHello ServerreplicareferencesHelloServerHelloServer HelloFactoryCreateHello Serverobject<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server Launcher Main// Set type properties for the Hello Server typetry{helloServertId = <strong>CORBA</strong>::string_dup("IDL:omg.org/HelloServer:1.0");helloServerProp.length(10);helloServerProp[0].nam.length(1);helloServerProp[0].nam[0].id= <strong>CORBA</strong>::string_dup("org.omg.ft.Replicati<strong>on</strong>Style");helloServerProp[0].nam[0].kind = <strong>CORBA</strong>::string_dup("string");helloServerProp[0].val


Hello Server Launcher MainhelloServerProp[6].nam.length(1);helloServerProp[6].nam[0].id =<strong>CORBA</strong>::string_dup("org.omg.ft.InitialNumberReplicas");helloServerProp[6].nam[0].kind = <strong>CORBA</strong>::string_dup("string");helloServerProp[6].val


Hello Server LauncherHelloServerLauncherPublishHello Serverobject groupreferenceReturnHello Serverobject groupreferenceObtainHello Serverreferenceset_type_properties()Invokecreate_object()Replicati<strong>on</strong>ManagerHelloClientInvokehello()Invokecreate_object()ReturnHello ServerreplicareferencesHelloServerHelloServer HelloFactoryCreateHello Serverobject<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server Launcher Main// Narrow the Replicati<strong>on</strong> Manager’s object reference// to a Generic Factory reference and invoke create_object()genFact = FT::GenericFactory::_narrow(repMgr);if (!<strong>CORBA</strong>::is_nil(genFact)){theCriteria.length(0);helloServerRef = genFact->create_object(helloServerTId, theCriteria, fcId);<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server LauncherHelloServerLauncherPublishHello Serverobject groupreferenceReturnHello Serverobject groupreferenceObtainHello Serverreferenceset_type_properties()create_object()Replicati<strong>on</strong>ManagerHelloClientInvokehello()Invokecreate_object()ReturnHello ServerreplicareferencesHelloServerHelloServer HelloFactoryCreateHello Serverobject<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server Launcher Mainif (!<strong>CORBA</strong>::is_nil(helloServerRef)){// Publish the IOR of the Hello Server for the Client to readbuffer = orb->object_to_string(helloServerRef);fd = fopen( "HelloServerIOR", "w" );if (fd == NULL){ cerr


Hello Server Factory1. Invoked by FT<strong>CORBA</strong> rather than directly by the user2. Extract the ObjectId from the criteria3. Check the type_id to determine the object to create• The factory may be able to create several types of objects4. Create the object and activate it5. Record the object locally to enable deleti<strong>on</strong>• The index of the object in this local sequence is returnedas an out parameter to enable deleti<strong>on</strong>• A more sophisticated implementati<strong>on</strong> of the factorywould reuse indices6. Return the object reference of the object just created<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server FactoryHelloServerLauncherPublishHello Serverobject groupreferenceReturnHello Serverobject groupreferenceObtainHello Serverreferenceset_type_properties()create_object()Replicati<strong>on</strong>ManagerHelloClientInvokehello()Invokecreate_object()ReturnHello ServerreplicareferencesHelloServerHelloServer HelloFactoryCreateHello Serverobject<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server Factory Implementati<strong>on</strong><strong>CORBA</strong>::Object_ptr FactoryImpl::create_object(c<strong>on</strong>st char* type_id, c<strong>on</strong>st FT::Criteria& the_criteria,FT::GenericFactory::FactoryCreati<strong>on</strong>Id_out factory_creati<strong>on</strong>_id)throw(FT::NoFactory, …){ <strong>CORBA</strong>::Object_ptr helloServerRef;PortableServer::ObjectId *objId;int i, n, found;try{ i = 0; found = 0; n = the_criteria.length();while ((i>= objId);}i++;}if (found == 0) { …<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


if (strcmp(type_id, "IDL:omg.org/HelloServer:1.0") == 0){helloServerServant = new HelloServerImpl();myPoa->activate_object_with_id(*objectId, helloServerServant);helloServerRef = myPoa->create_reference_with_id(*objectId, “IDL:omg.org/HelloServer:1.0");}else{throw FT::NoFactory();}<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server FactoryHelloServerLauncherPublishHello Serverobject groupreferenceReturnHello Serverobject groupreferenceObtainHello Serverreferenceset_type_properties()create_object()Replicati<strong>on</strong>ManagerHelloClientInvokehello()Invokecreate_object()ReturnHello ServerreplicareferencesHelloServerHelloFactoryCreateHello Serverobject<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server Factory Implementati<strong>on</strong>// create_object() c<strong>on</strong>tinuednumberOfObjects++;objectSeq.length(numberOfObjects);objectSeq[numberOfObjects-1] = <strong>CORBA</strong>::Object::_duplicate(helloServerRef);factory_creati<strong>on</strong>_id = new FT::GenericFactory::FactoryCreati<strong>on</strong>Id();(*factory_creati<strong>on</strong>_id)


Hello Server Factory Main1. Initialize the ORB2. Initialize the POA3. Create the Factory object• The Factory object is <strong>on</strong>ly invoked locally by FT<strong>CORBA</strong>Its object reference must never escape from this process4. Initialize FT<strong>CORBA</strong>• C<strong>on</strong>nects to the Replicati<strong>on</strong> Manager• Receives commands to create objects andinvokes the Factory to create the local replica5. Set the ORB running<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server Factory Mainint main(int argc, char** argv){try{myOrb = <strong>CORBA</strong>::ORB_init(argc, argv);if (!<strong>CORBA</strong>::is_nil(myOrb)){rpObj = myOrb->resolve_initial_references("RootPOA");myPoa = PortableServer::POA::_narrow(rpObj);<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server Factory Mainif (!<strong>CORBA</strong>::is_nil(myPoa)){// Create myFactory servantmyFactoryServant = new FactoryImpl();myFactoryOid = myPoa->activate_object(myFactoryServant);// Create an object reference for myFactory servanttempMyFactory = myPoa->create_reference_with_id(*myFactoryOid, "IDL:omg.org/Factory:1.0");// Narrow the reference to the Generic Factory interfacemyFactory = FT::GenericFactory::_narrow(tempMyFactory);<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server Factory Main// Must NOT export the object reference for myFactoryServant// New replicated objects are created by invoking the// create_object() method of the Replicati<strong>on</strong> Manager// Initialize FT<strong>CORBA</strong>FT<strong>CORBA</strong>_init(myOrb, myPoa, myFactory, argc, argv);}// Using the ORB, make myFactory ready to receive requestsmyOrb->run();<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server Implementati<strong>on</strong>The implementati<strong>on</strong> of Hello Server is very simple1. Obtain the name of the client as a parameter2. Append “Hello” to the fr<strong>on</strong>t of it3. Append “!” to the back of it4. Return the reply<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Server Implementati<strong>on</strong><strong>CORBA</strong>::String HelloServerImpl::hello(c<strong>on</strong>st char* hellostring){char hellostring2[200];strcpy(hellostring2, "Hello ");strcat(hellostring2, hellostring);strcat(hellostring2, "!");}return <strong>CORBA</strong>::string_dup(hellostring2);<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Client Main1. Initialize the ORB2. Obtain a reference to an active Hello Server3. Invoke the hello() method of the Hello Server<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello ClientHelloServerLauncherPublishHello Serverobject groupreferenceReturnHello Serverobject groupreferenceset_type_properties()ObtainHello ServerreferenceHelloClientcreate_object()Replicati<strong>on</strong>ManagerInvokehello()Invokecreate_object()ReturnHello ServerreplicareferencesHelloServerHelloServer HelloFactoryCreateHello Serverobject<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000


Hello Client Main// Obtain the Hello Server Object Reference: obj…// Narrow the object to a Hello ServerHelloServer_var server = HelloServer::_narrow(obj);if (!<strong>CORBA</strong>::is_nil((HelloServer_ptr)server)){<strong>CORBA</strong>::String_var returned;c<strong>on</strong>st char* hellostring = "client";// Invoke the hello() method of the remote serverreturned = server->hello(hellostring);cout


<strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong>• For more informati<strong>on</strong>, c<strong>on</strong>tact:Louise Moser, Michael Melliar-Smith, Priya NarasimhanEternal Systems, Inc.P.O. Box 13963Santa Barbara, CA 93107Ph<strong>on</strong>e: +1-805-893-4897Fax: +1-805-893-3262Email: moser @eternal-systems.compmms @eternal-systems.compriya @eternal-systems.com<str<strong>on</strong>g>Tutorial</str<strong>on</strong>g> <strong>on</strong> <strong>Fault</strong> <strong>Tolerant</strong> <strong>CORBA</strong> © Eternal Systems, Inc, 2000

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!