METHOD AND SYSTEM FOR UPDATING POSITION INFORMATION IN A DISTRIBUTED SYSTEM WITH CODE MOBILITY

Abstract: Methods and systems in accordance with the present invention allow mobile objects to move about a distributed system without notifying each client that may need to locate and access the object of their new location. The clients have leases on objects that they use, and the leases specify the amount of time that the client will need to access the mobile object and must know how to locate the mobile object. When an object moves from its current location and has valid unexpired leases from one or more clients, a forwarding pointer is left on the server from which the object is leaving and contains information regarding the new location of the object and its set of current leases or its longest outstanding lease. The forwarding pointer directs clients to the object's new location and can be erased or garbage collected when the set of leases are no longer valid because no more clients will be accessing that location for the corresponding mobile object. Thus, its memory space may be reclaimed and reused, and system resources are used more efficiently.

Description: METHOD AND SYSTEM FOR UPDATING POSITION INFORMATION IN A DISTRIBUTED SYSTEM WITH CODE MOBILITY RELATED APPLICATION This application is a Continuation-In-Part of U.S. Patent Application Serial No.09/152,062, entitled "Methods, Apparatus, and Product for Distributed Garbage Collection," filed September 11, 1998, which is herein incorporated by reference. BACKGROUND Field of the Invention This invention generally relates to a data processing system, and more particularly to a method and system for updating position information of mobile entities in a distributed system. Related Art In a computer network or distributed system made up of cooperating computational entities, herein referred to as "objects," running on a number of machines, it is often desirable to allow some of these objects to move from one machine to another. These objects may be any computational entity, code, or software, and reasons for this movement include: (i) to allow balancing the load on the overall system, (ii) to allow the computation to be co-located with some block of data, or (iii) to allow multiple cooperating processes to become co-located to share information. Finding such an object once it has moved becomes a problem in such systems. The problem of locating mobile objects in a network is discussed extensively in agent technology literature such as "Mobile Object Systems: Towards the Programmable Internet," J. Vitek and C. Tschudin eds., Springer- Verlag, 1997. Approaches to solve this object mobility problem generally take one of three forms. In the first, the object that is moving is responsible for telling a client that might be interested in the object of its new location. The problem with this approach is that the moving object might not be able to tell every interested client, either because of network faults or because it does not know all of the clients that currently have a pointer to the moving object showing the client the current location of the object. In addition, such updates can be unnecessarily expensive, because they might update clients that no longer care about the location of the mobile objects. A second conventional solution to the mobile object problem is to leave a forwarding pointer, sometimes referred to as a "tombstone," at the current location of the moving object which will act as a forwarding agent, directing any communication to the mobile object at its new location. This approach also has object mobility problems - the forwarding pointers need to be left at every location at which the mobile object has existed, taking up valuable system resources, and if the machine on which a forwarding pointer is placed ever becomes unavailable, the mobile object may not be capable of being found by some set of clients that are interested in it. A third conventional approach to solve the object mobility problem is to leave a single "anchor" for the mobile object at the original location of the object. This anchor must be informed of every move of the mobile object so that it will always know the current address of the object and forward any communication to that current address. The problem with this approach is that it requires that the original location of the mobile object always exist for the lifetime of the object, and always be available. Further, it especially requires that the anchor must be available and reachable from any location to which the mobile object might go. As such, it would be desirable to have a method and system that avoids the problems associated with conventional solutions for handling object mobility. SUMMARY Methods and systems in accordance with the present invention allow mobile computational entities or objects in a distributed system to move and leave forwarding pointers. The object's clients take "leases" on the object for the period of time they will need to access the object. The forwarding pointers are created when an object leaves a server and contain information on the set of leases or the longest outstanding lease held by client(s) on the mobile object. The forwarding pointers allow an object to move from one server to another server without notifying its clients, and the memory space of the forwarding pointers may be reclaimed when they are no longer needed. As a result, if a mobile object moves many times and leaves many forwarding pointers, they will not unnecessarily consume memory resources whereas old forwarding pointers will automatically disappear. In accordance with the present invention, a method performed by a server for updating information on an object's location in a distributed system stores a forwarding pointer for an object, the forwarding pointer having information on a lease to the object, and receives a request from a client to access the object. It accesses the forwarding pointer for forwarding information associated with the object, and returns the forwarding information associated with the object to the requesting client. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 shows a network having several client and server computers in accordance with the present invention; Figure 2 illustrates hardware and software components of a computer system in accordance with the present invention; Figure 3 depicts several client and server computers and a mobile object that has not changed locations in accordance with the present invention; Figure 4 shows several client and server computers, a mobile obj ect that has moved once, and a forwarding pointer in accordance with the present invention; Figure 5 is a flowchart illustrating steps used in a method for a client to request a client access to a mobile object in accordance with the present invention; Figure 6 illustrates several client and server computers, a mobile object that has moved twice, and two forwarding pointers in accordance with the present invention; and Figure 7 is a flowchart illustrating steps used in a method using a forwarding pointer in accordance with the present invention. DETAILED DESCRIPTION Methods and systems in accordance with the present invention allow the location of mobile computational entities or software, referred to herein as "objects," to be updated efficiently and in a fault-tolerant distributed system. They allow mobile objects to move about a distributed system without notifying each client that may need to locate an object of its new location. Generally, methods and systems in accordance with the present invention combine the use of forwarding pointers with the concept of a software "lease" described below. To more efficiently update the location of mobile objects, a forwarding pointer is left on the server from which the object is leaving, and the forwarding pointer contains information regarding the new location of the object and information regarding the unexpired or "valid" leases on the object or the longest outstanding valid lease. In accordance with the present invention, clients lease references to the objects in the distributed system that allow the clients to locate and access the objects when they are needed. When a reference to such a distributed mobile obj ect is obtained, it is only guaranteed to be valid for a period of time negotiated by the requester and the entity that hands out the reference. The lease of the reference is the period of time that the reference is guaranteed. The holder of the reference may renew the lease prior to the expiration of the lease or explicitly cancel the lease during the lease. However, if the holder of the leased reference does not take either of these actions, the expiration of the lease allows the grantor of the lease to invalidate the outstanding reference. Further, if the holder of the reference is unable or unwilling to renew the lease prior to expiration, the holder of the leased reference also knows that the reference is now invalid. Leasing is described in detail in U.S. Patent No. 5,832,529, entitled "Methods, Apparatus, and Product for Distributed Garbage Collection," which was previously incorporated by reference. Methods and systems in accordance with the present invention combine leasing with forwarding pointers. When an object moves from its current location and has valid unexpired leases from one or more clients, it leaves a forwarding pointer that contains forwarding information of the new location of the object as well as information regarding the set of leases or the longest outstanding lease that is valid at the time the object leaves the current location. This forwarding pointer exists until all valid leases to the object have expired because a mobile object must have a way to inform all clients having valid leases on the object how to reference it. This forwarding pointer can be erased or garbage collected when the leases it contains are no longer valid because no more clients will be accessing that location for the corresponding mobile object. Thus, its memory space may be reclaimed and reused. When a client is not aware of an object's move to a new location, the forwarding pointer receives the request from the client to access the object and returns the forwarding information to the client and/or forwards the request to the new location. Similarly, if a client is not aware of the mobile object's move and requests a renewal on a lease, the forwarding pointer receives the request from the client but does not renew the lease. Again, it returns the forwarding information to the client and/or forwards the call to the object so that the client may make the lease renewal request to the mobile object. If a client has no lease on a mobile object or its lease expires, it must locate the mobile object through other methods such as a directory service. Figure 1 shows a data processing system 100 suitable for use with methods and systems consistent with the present invention with several client computers 101 and 103 and server computers 102, 104 and 106 connected via a network 110, such as the Internet, a wide area network ("WAN") or a local area network ("LAN"). Typically, client computers 101 and 103 receive data from server computers 102, 104 and 106. Although five computers are shown in Figure 1, one skilled in the art will recognize that the system 100 may include many more computers. Furthermore, a server computer may also act as a client computer and receive data from any other computer connected to network 110, and similarly, a client computer may also act as a server computer and send data to other computers connected to network 110. Figures 2 depicts a more detailed block diagram of a computer in accordance with the present invention, and the computer may represent any one of the client or server computers. In this case, client computer 101 is show and includes a central processing unit (CPU) 202, a main memory 204, and a secondary storage device 206 interconnected via bus 208. Additionally, client computer 101 includes a display 210, and an input device 212. The client computer is also connected to a network 110. The main memory 204 contains a forwarding pointer 214, which references a mobile object, and a mobile object 216, which may be any mobile computational entity, object or software. Many mobile objects 212 and forwarding pointers 214 may reside in the memories of a client computer or server computer. One skilled in the art will appreciate that aspects of methods and systems consistent with the present invention may be stored on or read from other computer readable media besides memory like secondary storage devices, such as hard disks, floppy disks, and CD ROM, or a carrier wave from a network such as the Internet. Additionally, one skilled in the art will also appreciate that the computer system may contain additional or different components. Figure 3 depicts several client and server computers and a mobile object that has not changed locations. This figure shows client computers 101 and 103, both having current leases on a mobile object 212 located on server 102. Also shown are server computers 104 and 106. Figure 4 illustrates the same client and server computers 101 - 104, and 106, as well as the same mobile object 212. In this figure, however, it is shown that the mobile object 212 has moved from server 102 to server 104, and that client 101 is attempting to access the mobile object 212 by contacting the server 102. In accordance with the present invention, a forwarding pointer 214 has been created and left behind on the server 102. These Figures 3 and 4 will be used in conjunction with the following Figures 5 and 6 to illustrate methods and systems in accordance with the present invention. Figure 5 is a flowchart illustrating steps used in a method for requesting by a client access to a mobile object in accordance with the present invention. When a client 101 requests access to a mobile object 212 (step 502), it first determines whether it has a valid, lease to the mobile object (step 504). If not, it must search for and access the mobile object 212 through other methods (step 506). If the client 101 does have a valid lease on the mobile object 212, the client sends a request to access the mobile object 212 to its last known location. If the mobile object 212 is there (step 510), the client 101 may access the mobile object 212 which may then return a result to the client (step 512). Figure 3 illustrates this situation. The client 101 accesses the server 102 and finds the mobile object 212 on that server. If, however, the mobile object 212 is not on the accessed server 102, the client 101 receives forwarding information pointing to the location where the mobile object moved when it left the server 102 (step 514). Referring back to Figure 4, client 101 is shown accessing server 102 and being forwarded to mobile obj ect 212 on server 104 by forwarding pointer 214. As shown on the flowchart of Figure 5, these steps 508, 510, and 514 may be repeated if the mobile object 212 has made several moves since the client' s 101 last attempt to access the mobile object. Figure 6 illustrates this scenario with several client and server computers 101 - 104, and 106, a mobile object 212 that has moved twice, and two forwarding pointers 214 and 216 in accordance with the present invention. In this scenario, the mobile obj ect 212 has moved twice, once from server 102 to server 104, and once from server 104 to server 106. As shown, the client 101 was aware of neither move and will try to access the mobile object 212 at its last known location on server 102 where it will be forwarded to server 104 and then server 106. Aspects of the creation and operation of forwarding pointers consistent with the present invention will now be discussed. Figure 7 is a flowchart illustrating steps used in a method using a forwarding pointer in accordance with the present invention. Also with reference to Figure 4, when a mobile object 212 moves (step 702) from one server 102 to another server 104, the server 102 first determines if there are any valid leases on the object at the time of the move (step 704). If there are none, the object may move and nothing else needs to be done regarding forwarding. If there are valid leases held on the mobile object 212 at the time of the move, a forwarding pointer 214 is created with the forwarding information for the mobile obj ect and the current set of valid leases on the object at the time of the move. In one implementation consistent with the present invention, the forwarding pointer contains information regarding the longest outstanding valid lease held to the object instead of the set of valid leases. When the leases contained in the forwarding pointer 214 expire (step 708), the memory space used by the forwarding pointer 214 can be reclaimed or garbage collected (step 710), thereby freeing up memory resources. The system is assured that no other clients will need to access that location in search of the mobile object 212 when the last lease in the forwarding pointer 214 expires. If the server 102 containing the forwarding pointer 214 receives a request from a client 101 to access the mobile object 212 or renew a lease on the object (step 712), it returns to the client the forwarding information on the location to which the mobile object went when it left the server 102. Alternately, or additionally, server 102 forwards the request to the mobile object. In some situations, older forwarding pointers 214 may expire before newer ones if a mobile object 212 moves a lot and another client 103 requests a lease renewal. For example, if one client requests a lease renewal to an object that has moved, and another client is not aware of the object's original move, the forwarding pointer left when the object moves again will exist longer than the original forwarding pointer left from the first move as a result of the new longer lease. As such, methods and systems in accordance with the present invention allow mobile objects to move freely throughout distributed systems and allow clients to access the objects without constantly being updated of each move. Furthermore, they advantageously allow forwarding pointers to disappear when they are no longer needed, thereby freeing up system resources. The foregoing description of an implementation of the invention has been presented for purposes of illustration and description. It is not exhaustive and does not limit the invention to the precise form disclosed. Modifications and variations are possible in light of the above teaching or may be acquired from practicing of the invention. The scope of the invention is defined by the claims and their equivalents.

Claims: What is claimed is: 1. A method for updating information on an object's location in a distributed system, comprising the steps of: storing a forwarding pointer for an object, the forwarding pointer having information on a lease to the object; receiving a request to access the object; accessing the forwarding pointer for forwarding information associated with the object; and returning the forwarding information associated with the object. 2. The method of claim 1 , wherein the forwarding pointer includes information on a set of one or more leases to the object, the method further comprises the steps of: determining whether the set of leases has expired; and reclaiming memory associated with the forwarding pointer based on the determination. 3. The method of claim 1, wherein the step of receiving a request to access the object further includes the step of: receiving a request to renew the lease on the object. 4. A method for updating information on an object's location in a distributed system, comprising the steps, performed by a server in the system, of: storing a forwarding pointer for an object, the forwarding pointer having information on a lease to the object; receiving a request to access the object; and forwarding the request to the object using information on the location of the object from the forwarding pointer. 5. The method of claim 4, wherein the step of forwarding the request to the object further includes the step of: returning notification that the request has been forwarded. 6. The method of claim 5, wherein the step of forwarding the request to the object further includes the step of: returning forwarding information associated with the object. 7. A method for updating information on an obj ect's location in a distributed system, the method comprising the steps of: associating a lease with the object; establishing a forwarding pointer having information on the lease and location information associated with the object; and moving the object from a first server to a second server. 8. The method of claim 7, further including the step of: updating the location information to reflect movement of the object to the second server. 9. A computer-readable medium containing instructions for controlling a data processing system to perform a method for updating information on an object's location in a distributed system, comprising the steps of: storing a forwarding pointer for an object, the forwarding pointer having information on a lease to the object; receiving a request to access the object; accessing the forwarding pointer for forwarding information associated with the obj ect; and returning the forwarding information associated with the object. 10. The computer-readable medium of claim 9, wherein the forwarding pointer includes information on a set of one or more leases to the object, and the method further comprises the steps of: determining whether the set of leases has expired; and reclaiming memory associated with the forwarding pointer based on the determination. 11. The computer-readable medium of claim 9, wherein the step of receiving a request to access the object further includes the step of: receiving a request to renew the lease on the object. 12. A computer-readable medium containing instructions for controlling a data processing system to perform a method for updating information on an object's location in a distributed system, comprising the steps of: storing a forwarding pointer for an object, the forwarding pointer having information on a lease to the object; receiving a request to access the object; and forwarding the request to the object using information on the location of the object from the forwarding pointer. 13. The computer-readable medium of claim 12, wherein the step of forwarding the request to the object further includes the step of: return notification that the request has been forwarded. 14. The computer-readable medium of claim 12, wherein the step of forwarding the request to the object further includes the step of: returning forwarding information associated with the object. 15. A computer-readable medium containing instructions for controlling a data processing system to perform a method for updating information on an object's location in a distributed system, comprising the steps of: associating a lease with an object; establishing a forwarding pointer having information on the lease and location information associated with the object; and moving the object from a first server to a second server. 16. The computer-readable medium of claim 15, further including the step of: updating the location information to reflect movement of the object to the second server. 17. A distributed system comprising: means for storing a forwarding pointer for an object, the forwarding pointer having information on a lease to the object; means for receiving a request to access the object; means for accessing the forwarding pointer for forwarding information associated with the object; and means for returning the forwarding information associated with the object. 18. A distributed system having: a first computer having a memory containing a first object having a lease on a second object and a processor for making a call to the second object for the second object; and a second computer having a memory containing a forwarding pointer having information on the lease and a processor for receiving the call to the second object, accessing the forwarding pointer, and returning forwarding information to the first computer. 19. A distributed system having: a first computer having a memory containing a first object having a lease on a second object and a processor for making a call to the second object for the first object; a first server computer having a memory containing a forwarding pointer having information on the lease and a processor for receiving the call to the second object, accessing the forwarding pointer, and forwarding the call to the second object; a third computer having a memory containing the second object and a processor for receiving a forwarded call to the second object.

Inventors: WALDO JAMES H, WOLLRATH ANN M, WALDO, JAMES, H., WOLLRATH, ANN, M.
Applicants: SUN MICROSYSTEMS INC, SUN MICROSYSTEMS, INC.
Application year: 2000
Main classification: H04L29
IPC codes: G06F9