Instance Migration in Dynamic Software...

15
Instance Migration in Dynamic Soſtware Update P. Tesone 1,2 – G. Polito 1 – L. Fabresse 2 N. Bouraqadi 2 – S. Ducasse 1 (1) INRIA Lille–Nord Europe, France (2) Mines Douai, IA, Univ. Lille, France

Transcript of Instance Migration in Dynamic Software...

Page 1: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Instance Migration in DynamicSoftware Update

P. Tesone1,2 – G. Polito1 – L. Fabresse2

N. Bouraqadi2 – S. Ducasse1

(1)INRIA Lille–Nord Europe, France(2)Mines Douai, IA, Univ. Lille, France

Page 2: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

What is Dynamic Software Update?

● Updating a running application. Without needing toreinitialize the application.

● Guaranteeing the correct continuity of the execution.

● Evolving from one version to another (Code + State)

● Without losing state.

● Minimizing the downtime.

META ‘16 – Instance Migration in Dynamic Software Update

Page 3: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Two Use Cases

● Applications that can not be stopped (ex: global web applications, robotics, etc).

● Live Development Environments (ex: modifying data structures, complexrefactors, self modification).

● Similar requirements:

– Migration of state.

– Atomicity in the changes.

– Validation of the changes.

● But with some differences

– Size of the changes.

– Downtime.

– Concurrence.

META ‘16 – Instance Migration in Dynamic Software Update

Page 4: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Generic Update ProcessArchitecture.

DSU Operations & Abstractions

DSU Implementation

Platform Meta Level Operations

Virtual Machine Primitives

Patch Description

META ‘16 – Instance Migration in Dynamic Software Update

Page 5: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Some challenges of DynamicSoftware Update

● How to calculate the changes needed from one version to another.

● When to perform the changes.

● What to do with the running threads.

● How to migrate the data from one version to another.

● How to validate the changes.

● Rollback of the changes.

META ‘16 – Instance Migration in Dynamic Software Update

Page 6: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Instance Migration

● In a OO Environment the state of the application isrepresented in instances inside the environment.

● The current state has to be preserved betweenversions.

● Any change in the structure or the usage of theobjects has to be updated.

META ‘16 – Instance Migration in Dynamic Software Update

Page 7: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Possible Changes

● Creating Instance Variables

● Removing Instance Variables

● Renaming Instance variables.

● Change in the value / usage of an instance variable.

● All this changes can be applied to a hierarchy,needing to be propagated.

META ‘16 – Instance Migration in Dynamic Software Update

Page 8: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Instance Migration Requirements

● Atomicity

● Eager / Lazy

● Support of Application dependent migrations.

● Support of System and Application Validations

● Coherence

● Composability

● Support of both use cases.

● Handling global state.

META ‘16 – Instance Migration in Dynamic Software Update

Page 9: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Proposed Solution

1.The patch declares all the changes to perform.

2.The update process copy the namespace.

3.The update process performs all the changes in the new namespace.

4.The update process migrates all the instances to its new format (ifneeded).

5.The new namespace can be validated

6.If everything is correct all the old objects are replaced with the newobjects, replacing the existent namespace with the new one (BulkReplace).

META ‘16 – Instance Migration in Dynamic Software Update

Page 10: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Proposed Interface to Express theChanges.

addClass(classDef)changeSuperclass(subclass, superclass)removeClass(class)addInstanceV ariable(class, variableDef, initialV alue: MigrationPolicy) removeInstanceV ariable(class, variableName)renameInstanceV ariable(class, oldV ariableName, newV ariableName)migrateInstances(class, migrator: MigrationPolicy)addV alidation(validation:V alidation)beginT ransaction()commit()rollback()

DSUOperations

Validation MigrationPolicyRequired

MOP

META ‘16 – Instance Migration in Dynamic Software Update

Page 11: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Required Operations

readClassDef nition(Class):ClassDefcreateClass(classDef):ClassreadInstanceV ariable(instance, variableName): valuewriteInstanceV ariable(instance, variableName, value)allInstances(Class):ListcloneNamespace(namespaceName):NamespacereplaceNamespace(namespaceName,newNamespace:Namespace)swapObjects(oldObjects:List, newObjects:List)

RequiredMOP

META ‘16 – Instance Migration in Dynamic Software Update

Page 12: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Detected Abstractions

● Migration Policies

– General migration policies

– Application Dependent

● Validations

– System consistence

validations

– Application’s

Validations

migrate ( oldObject, newObject,oldNamespace, newNamespace):void

MigrationPoliciy

execute (oldNamespace, newNamespace) : Boolean

Validation

System Validation 1

ApplicationValidation 1

System Validation N

ApplicationValidation M... ...

META ‘16 – Instance Migration in Dynamic Software Update

Page 13: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Implementation Details

● Implemented as a Prototype in Pharo.

● Supporting the update in the two use cases.

● Implemented as Image side component, no VM modification needed.

● The full lifecycle of the update process is implemented.

● Allows research in different alternatives to the different aspects.

● Simple solutions for some aspects:

– Patch creation

– Quiescent point detection

– Stack manipulation

META ‘16 – Instance Migration in Dynamic Software Update

Page 14: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Future work

● Studying the differences when using lazy migration.

● Restricting the number of objects to copy.

● Minimize the downtime (or maximize the operationsthat can be done without stopping the application)

● Improving the detection of changes and providingmore automatic generated migration policies.

● Smarter detection of Quiescent points.

META ‘16 – Instance Migration in Dynamic Software Update

Page 15: Instance Migration in Dynamic Software Updatecar.imt-lille-douai.fr/luc/files/pdfs/2016-Tesone-META-slides.pdf · Implementation Details Implemented as a Prototype in Pharo. Supporting

Thank you so much!