Naming

Document Sample
Naming Powered By Docstoc
					Distributed Systems

         Removing Unreferenced
               Entities
             Chapter 4.3
              Course/Slides Credits
    Note: all course presentations are based on those
     developed by Andrew S. Tanenbaum and
     Maarten van Steen. They accompany their
     "Distributed Systems: Principles and
     Paradigms" textbook.
     http://www.prenhall.com/divisions/esm/app/aut
     hor_tanenbaum/custom/dist_sys_1e/index.html
    And additions made by Paul Barry in course
     CW046-4: Distributed Systems
     http://glasnost.itcarlow.ie/~barryp/net4.html
2
        Distributed Garbage Collection
    • Removing unreferenced entities can be tricky.
    • As soon as a entity is no longer required, it
      (and any copies of it and/or references/pointers
      to it) needs to be removed from the distributed
      system.
    • For an example of this type of problem, just
      look at the mess of unreferenced HTML
      documents (“broken links”) on today’s Internet
    • [As an aside: part of the XML technology hopes to fix this
      problem … the jury is still out on this one].
3
     The Problem of Unreferenced Objects




    An example of a graph representing objects containing references
4     to each other.
      Removing Unreferenced Entities
    • Managing the removal of entities in a
      distributed system is often difficult.
    • Consider: is every reference to an entity an
      intention to access it at some later date?
    • It is not acceptable to never remove an entity –
      all garbage needs to be collected.
    • Consequently, a number of Distributed
      Garbage Collection mechanisms have been
      devised.
5
              What’s the Problem?
    • Simple: an unreferenced entity is no longer
      needed and should be removed from the DS.
    • A sick twist: a reference to an object which
      references another object, which in turn
      references another object, which references the
      first object (forming a “cycle”) needs to be
      detected and removed.
    • Garbage collection is well understood in
      uniprocessor systems and easily implemented.
      Things are considerable more complex when it
6     comes to DSes.
                 Critical Questions
    • What type of communication is required to
      maintain references and perform distributed
      garbage collection?
    • What happens when the communications
      system is subject to process failures and errors?
    • A number of solutions are proposed.
    • Unfortunately, each only solves a part of the
      problem.

7
        Generic Solution: Reference Counting
    •   Increment at counter when an object is referenced.
    •   Decrement a counter when an object reference is no longer needed.
    •   Delete the object when the reference count is zero.
    •   Leads to several problems, mainly due to unreliable communications.




8
               Reference Counting (2)




    a)   Copying a reference to another process and incrementing the
         counter too late.
9   b)   A solution.
     Advanced Referencing Counting (1)




     a)   The initial assignment of weights in weighted reference
          counting.
10   b)   Weight assignment when creating a new reference.
     Advanced Referencing Counting (2)




11     c)   Weight assignment when copying a reference.
     Advanced Referencing Counting (3)




     Creating an indirection when the partial weight of a reference has
12     reached 1.
     Advanced Referencing Counting (4)




     Creating and copying a remote reference in generation reference
13     counting.
               Tracing in Groups (1)




14   Initial marking of skeletons.
               Tracing in Groups (2)




     After local propagation in each process.
15
               Tracing in Groups (3)




16   Final marking.
                Adding Robustness
     • Lost acknowledgements are easy to detect and
       deal with (a problem that has been solved by
       many other networking technologies).
     • Duplicates can also be handled.
     • A number of reliable enhancements to simple
       reference counting exist, but suffer from
       performance and scalability problems (they are
       also complex):
        – Weighted Reference Counting
        – Generation Reference Counting
17
             Enhancements to Counting
     • Reference Listing: an reference count is not
       maintained. Instead, as list of proxies that point to the
       object is maintained by the object.
     • The list has some important properties: if a proxy is
       already in the list, adding it again does not change the
       list. Also, if a proxy is not in the list, removing it from
       the list does not change the list.
     • Reference Listing is said to be “idempotent” – an
       operation can be repeated any number of times without
       affecting the end result. So a proxy can keep adding &
       removing itself from the list until an ACK is returned.
     • Key point: duplicates are OK, and reliable
       communications is NOT required.
18
              Think About This …
     • Increment and Decrement are not idempotent.




19
             More on Enhancements
     • Reference Listing is used by Java’s RMI.
       – The object keeps track of those remote processes
         that current have proxies to it.
       – Big disadvantage (with all Reference Listing
         systems): they scale poorly when there’s many
         references to the list.
     • Alternative: Reference Tracing.
       – Keeps track of every object in the DS.
       – A fine idea, but inherently unscalable (and a bit
         complex, too).
20
                Summary (Naming)
     • Names refer to entities, which are organized
       into name-spaces.
     • Address: an entities access point.
     • Identifier: one-to-one mapping to an entity.
     • Name: human friendly descriptor.
     • Traditional naming systems include DNS and
       X.500.
     • Neither are suited to distributed systems which
       must support mobile entities.
21
                  Summary (Naming)
     • Four approaches to finding/naming mobile
       entities:
       –   Broadcasting/multicasting: only works on LAN’s.
       –   Forwarding pointers: large chains cause problems.
       –   Home based systems: e.g., Mobile-IP.
       –   Hierarchical, dynamic domains.
     • Removal of “no longer needed” entities is
       important.

22
               Summary (Naming)
     • Distributed systems garbage collection
       technologies are organized around:
       – Simple reference counting systems.
       – Reference tracing.
       – Reference Lists.
     • All have their advantages/disadvantages.


23

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:2
posted:6/4/2012
language:
pages:23