US7240058B2 - Lock mechanism for a distributed data system - Google Patents

Lock mechanism for a distributed data system Download PDF

Info

Publication number
US7240058B2
US7240058B2 US10/087,234 US8723402A US7240058B2 US 7240058 B2 US7240058 B2 US 7240058B2 US 8723402 A US8723402 A US 8723402A US 7240058 B2 US7240058 B2 US 7240058B2
Authority
US
United States
Prior art keywords
access
primary state
state
locked
attributes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active, expires
Application number
US10/087,234
Other versions
US20030167268A1 (en
Inventor
Ajay Kumar
Hanumantha Rao Susarla
Prakash Khemani
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oracle America Inc
Original Assignee
Sun Microsystems Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sun Microsystems Inc filed Critical Sun Microsystems Inc
Priority to US10/087,234 priority Critical patent/US7240058B2/en
Assigned to SUN MICROSYSTEMS, INC. reassignment SUN MICROSYSTEMS, INC. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: KHEMANI, PRAKASH, KUMAR, AJAY, SUSARLA, HANUMANTHU RAO
Publication of US20030167268A1 publication Critical patent/US20030167268A1/en
Application granted granted Critical
Publication of US7240058B2 publication Critical patent/US7240058B2/en
Assigned to Oracle America, Inc. reassignment Oracle America, Inc. MERGER AND CHANGE OF NAME (SEE DOCUMENT FOR DETAILS). Assignors: Oracle America, Inc., ORACLE USA, INC., SUN MICROSYSTEMS, INC.
Active legal-status Critical Current
Adjusted expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2336Pessimistic concurrency control approaches, e.g. locking or multiple versions without time stamps
    • G06F16/2343Locking methods, e.g. distributed locking or locking implementation details
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99931Database or file accessing
    • Y10S707/99938Concurrency, e.g. lock management in shared database

Definitions

  • This invention relates to providing quality of service in a networked environment, and more particularly to a quality of service mechanism for lock mechanisms to address data clobbering in distributed data systems.
  • a session may include a series of user-application interactions that may be tracked by one or more servers. Sessions may be used for maintaining user-specific states, and may include persistent objects (e.g. handles to Enterprise Java Beans and/or database record sets) and authenticated user identities, among other interactions. For example, a session may be used to track a validated user login followed by a series of directed activities for that particular user. The session may reside in a server. For each request, a client may transmit a session ID in a cookie or, if the client does not allow cookies, the server may automatically write a session ID into a URL. The session ID may be used as a database key to access persistent objects associated with the client. Types of sessions may include, but are not limited to, distributed sessions and local sessions. Distributed sessions may be distributed among multiple servers, for example in a cluster, whereas local sessions may be bound to an individual server.
  • persistent objects e.g. handles to Enterprise Java Beans and/or database record sets
  • authenticated user identities e.g. handles to Enterprise Java Beans
  • Distributed sessions may facilitate scalability, fail-safe techniques, and security.
  • a web server may distribute activity to remain scalable with respect to network traffic.
  • a complete description (referred to as “session data”) of a distributed session may include state information for each process and/or computing system over which the session is distributed.
  • session data may include a snapshot of a session between a web browser and a web server may include one or more of the state of the web browser process(es), the state of the computing system hosting the web browser, the state of the web server process(es), the state of the computing system hosting the web server, the state of the computing system hosting an application server providing content to the web server, the sate of the application server process(es), and the state of one or more applications, processes and/or threads hosted by the application server or optionally on any other system involved in the distributed session.
  • the primary state may be defined as a global instance of session data accessible by one or more application servers.
  • a client state may be defined as a local instance of session data on an application server.
  • the client state may include session data from internal or external client interaction with the application server.
  • the client may include, but is not limited to, a process, a thread within a process, or an application running on one or more external or internal devices and/or computing systems.
  • the client states may serve as interfaces between clients, application servers, and the primary state, and may provide read and/or write access to the primary state to the application servers.
  • Client-server applications may store distributed session information as snapshots of the states of participating processes, resources, and computing systems to minimize data loss in case of failure.
  • Current techniques for storing state information from distributed sessions may result in inconsistent primary state data and consume significant amounts of resources.
  • Client state information may be retrieved and written by multiple servers at the same time resulting in data loss. For example, an application on one server may access session data in a primary state, while another application on another server accesses the same session data. Then, the first application may update the session data. The second application may update the session data after the first application. Portions of the session data updated by the first application may be overwritten, resulting in loss of data. This data loss may be referred to as “data clobbering.”
  • State information involving multiple applications and servers across a network may consume significant network resources.
  • To update and/or backup state information a large amount of data may be sent to one or more network storage mediums thereby consuming network bandwidth and other resources.
  • Restoring state information from one or more network storage mediums may consume bandwidth and other resources as well.
  • Bandwidth and resource intensive state save operations may result in delays in servicing requests. Such delays may adversely affect the quality of service of the application.
  • a client-server system may include a distributed store configured to maintain a primary state of session data.
  • the system may also include one or more application servers that each may include a client state of the session data for access by clients of the system.
  • the session data may include one or more attributes.
  • the distributed store may provide locked access to the primary state to a process executing within one of the application servers. While the primary state is locked for the process, other processes may not access the primary state. In one embodiment, the distributed store may provide locked access to portions of the primary state to threads executing within the process. While a thread has locked access to a portion of the primary state, other threads executing within the process cannot access the portion of the primary state.
  • the distributed store may buffer requests for locked access from other processes executing within one or more of the application servers. In one embodiment, the distributed store may request that the process release the locked access. The process may release the locked access in response to said request. In another embodiment, the process may release the locked access when the process no longer requires locked access to the primary state.
  • Another process waiting for locked access may suspend execution until locked access to the primary state is granted to the process.
  • one or more threads of the process may continue execution until locked access to the primary state is granted to the process.
  • the distributed store may provide locked access to one of the other processes in response to the other process's buffered request.
  • FIG. 1 illustrates an exemplary enterprise information system (EIS) with distributed session data according to one embodiment.
  • EIS enterprise information system
  • FIGS. 2A , 2 B, and 2 C illustrate a locking mechanism for controlling access to a primary state according to one embodiment.
  • FIG. 3 illustrates a method for providing locked access to a primary state of session data according to one embodiment.
  • FIG. 4 illustrates a method for providing locked access to a primary state according to one embodiment.
  • FIG. 5 illustrates a differencing mechanism for providing modified session data to a distributed store according to one embodiment.
  • FIG. 6 illustrates a method for using binary differencing to determine a client state delta according to one embodiment.
  • FIG. 7 illustrates a method for using object graph differencing to determine a client state delta according to one embodiment.
  • FIGS. 8A and 8B illustrate embodiments of determining accessed attributes of session data.
  • FIG. 9 illustrates embodiments of a method of tracking accessed attributes.
  • the application server may include a client state.
  • FIG. 10 illustrates embodiments of a method of providing attributes to a distributed store according for synchronization of a primary state with a client state.
  • FIG. 11 illustrates a distributed store using a differencing mechanism to synchronize instances of a primary state according to one embodiment.
  • FIG. 12 illustrates a method for updating instances of a primary state using binary differencing to determine a primary state delta according to one embodiment.
  • FIG. 13 illustrates a method for updating instances of a primary state using object graph differencing to determine a primary state delta according to one embodiment.
  • FIG. 14 illustrates a method of accessing and synchronizing state data according to one embodiment.
  • FIG. 1 illustrates an exemplary enterprise information system (EIS) with distributed session data according to one embodiment.
  • Enterprise server 102 may include one or more servers (e.g. web servers) that provide content to the clients 100 over network 10 .
  • Network 10 may be a wired or wireless network or a combination thereof, and may include a LAN, WAN, Internet, or a combination thereof. Any of a variety of one or more networking protocols may be used in the network, for example, TCP/IP.
  • Application servers 104 A and 104 B may include processes 106 A and 106 B respectively that may be used by the clients 100 to apply business logic to enterprise data.
  • Application servers 104 A and 104 B may include client states 108 A and 108 B respectively.
  • Clients 100 A, 100 B, and 100 C may be any of a variation of devices such as desktop personal computers, laptops, PDAs, and point-of-sale terminals running client applications such as web browsers.
  • Session data may include, but is not limited to, information related to environmental attributes, processes, and client-server interaction.
  • clients 100 may include web browsers accessing content generated by applications of application servers 104 .
  • the client states 108 are local instances of session data maintained by the application servers, for example, for use by clients of the application servers or by processes executing within the application servers.
  • Distributed store 110 may store persistent data including one or more instances of primary state 112 .
  • Primary state 112 may include an instance of the session data that is globally accessible by the application servers. In one embodiment, primary state 112 may be distributed on the network across one or more computer-accessible mediums (e.g. RAID systems and/or database systems).
  • one or more instances or copies of primary state 112 may be maintained on one or more backend systems that may serve as, for example, backup systems and/or fail-over systems.
  • distributed store 110 may include storage on one or more computer systems that also host one or more of application servers 104 .
  • the clients 100 may access enterprise server 102 via network 10 .
  • Enterprise server 102 may be implemented or clustered across one or more of the same computer systems as application servers 104 , or on one or more separate computer systems.
  • Enterprise server 102 may serve as a front end to the application servers for the clients 100 .
  • a client 100 may access enterprise server 102 during a session or during multiple sessions.
  • the applications and/or processes within the application servers may provide data and/or services to enterprise server 102 , for example, for use by the clients.
  • the application server may send updates of session data to distributed store 110 in response to an event such as a modification of one or more attributes of a client state 108 and/or as routine maintenance to synchronize the primary state with the client states.
  • An attribute may be a portion or element of the session data, and may be one of any of various types of data that may be used in a session such as programming language objects or classes (e.g. Java objects or classes), strings, integers, Booleans, characters, real number representations, or any other type of computer-representable data.
  • programming language objects or classes e.g. Java objects or classes
  • strings e.g. integers, Booleans, characters, real number representations, or any other type of computer-representable data.
  • a process 106 executing within an application server 104 may request a lock (e.g. mutex lock) of the primary state from distributed store 110 . If another process does not currently have the primary state locked, distributed store 110 may issue the lock to the requesting process 106 . If another process has the primary state locked, the process requesting the lock may enter a wait state or alternatively may continue executing another task while waiting for the lock. In one embodiment, a ‘lazy’ locking mechanism may be used in which when the process no longer requires locked access, the process does not release the lock immediately but may instead wait for a request for the lock. For example, the distributed store may request the lock from a process holding the lock in response to another process requesting a lock of the primary state.
  • a lock e.g. mutex lock
  • access to the primary state may be locked to allow a process or thread access to the primary state while blocking access to the primary state by other processes or threads.
  • locking of the primary state may be provided by a data synchronization mechanism.
  • the process of locking the primary state may include obtaining a token.
  • the token may include, but is not limited to, a string or a numeric identifier.
  • a process or thread may request locked access to the primary state from a locking mechanism.
  • the locking mechanism may send a reply message to the process or thread including a token.
  • the process or thread may access the primary state after receiving the token.
  • the process or thread may release the lock on the primary state by sending a release message to the locking mechanism including the token.
  • a process or thread that does not hold a token may not be allowed access to the primary state until the process or thread requests and receives the token.
  • a global lock may be provided at the process level and atomic locks may be provided at the thread level.
  • a global lock may be used to restrict concurrent access to the primary state at the process level.
  • the threads within the process having the global lock may use a thread-level lock to restrict access to portions of the session data of the primary state to a thread within the process holding the global lock.
  • the thread-level lock may block other threads within the process from concurrently accessing the locked portion of the session data.
  • the other threads may continue executing and one or more other threads within the process may lock other portions of the session data while the first thread is holding the lock on the first portion of the session data unless they require access to the portions of the session data that are locked at the thread level, at which point a thread may enter a wait state to wait for the thread holding the lock to release the lock.
  • FIGS. 2A , 2 B, and 2 C illustrate a locking mechanism for controlling access to a primary state according to one embodiment.
  • a process requests locked access to a primary state of session data on a distributed store.
  • a process 104 may request locked access to primary state 112 , for example, to update the primary state with modified session data.
  • Distributed store 110 may issue a lock to the requesting process in response to the request.
  • a lock may be required for every access to the primary state 112 .
  • a process 104 may prevent other processes and/or threads on the application server or other application servers from accessing the primary state.
  • the lock may be obtained and released on an access-by-access basis such that each time a process needs to access the primary state it must first obtain the lock for that primary state and then release the lock upon completion of its access.
  • after a process obtains a lock for a primary state it may continue to hold the lock after it has completed accessing the corresponding primary state. For example, in such an embodiment, the process holding the lock may not release the lock until after the it is requested to release the lock (e.g. by another process or by the distributed store manager). By holding the lock, a process that frequently access the same primary state may reduce its amount of lock requests.
  • Another embodiment may provide a global locking mechanism at the process level and a thread-level locking mechanism for threads within a process currently holding a global lock of the primary state.
  • the thread-level lock may allow threads to perform atomic-level locking of the session data.
  • the global/thread level locking mechanism may decrease the blocking that may be caused by per-access locking. Locking for individual thread-level access of the corresponding primary state may be handled more efficiently within the process and thus reduce the amount of process-level lock requests.
  • application server 104 A releases the lock, and locked access is provided to process 104 B.
  • process 104 A may release the lock when done accessing primary state 112 .
  • a ‘lazy’ release strategy may be used, wherein process 104 A holds the lock until requested to release the lock.
  • distributed store 110 may request the lock from process 104 A in response to receiving the request for locked access from process 104 B.
  • process 104 A may notify distributed store 110 of the release of the lock.
  • a lock release message may be sent from the process to the distributed store.
  • FIG. 3 illustrates a method for providing locked access to a primary state of session data according to one embodiment.
  • a process or thread may require access to a primary state of session data, and to protect the primary state from concurrent access by other processes or threads, the process or thread may request locked access to the primary state as indicated at 600 .
  • a client state of the session data on an application server may have been modified, and a process may request locked access to the primary state to synchronize the primary state with the client state on the application server.
  • locked access may be provide to the requesting process or thread as indicated at 602 .
  • the locked access may be provided by sending a token to the requesting process or thread.
  • the process or thread While holding the locked access, the process or thread may access the primary state as indicated at 604 , and other processes or threads may not be allowed access to the primary state.
  • data loss and/or incoherent data that may result from other processes and/or threads concurrently accessing the primary state of the session data may be prevented.
  • locked access may be granted globally at the process level and thus may prevent any other process or thread from accessing the primary state while the process holds the locked access.
  • locked access may be granted globally at the process level and locally at the thread level for threads of a process currently holding the process level lock, thus allowing for atomic locking of portions of the session data of the primary state by threads within the process.
  • process-level locked access may be managed through a distributed store data synchronization layer (e.g. distributed store manager) and the thread-level locked access may be managed within a process that holds the global lock. Thread-level locked access may allow threads within the process currently holding the global lock to lock the session data at a more atomic level, as opposed to the global lock which locks the entire primary state.
  • Thread-level locked access may be used to prevent threads within the process from concurrently accessing locked portions of the session data.
  • one or more threads within the process may lock other portions of the session data while a first thread is holding locked access on a first portion of the session data.
  • the thread may enter a wait state to wait for the locked access to be released.
  • FIG. 4 illustrates a method for providing locked access to a primary state according to one embodiment.
  • a request for locked access to the primary state may be received from a process or thread as indicated at 700 . If another process or thread does not currently hold locked access, locked access to the primary state may be provided to the requesting process or thread as indicated at 702 . Another request for locked access may be received from another process or thread as indicated at 704 . If the first process or thread currently holds locked access to the primary state, locked access may not be immediately granted to the other process or thread, but instead, the request may be held awaiting release of the locked access by the process or thread. In one embodiment, a request for locked access that is not immediately granted may be buffered with other pending requests for locked access, if any.
  • the process or thread may release the locked as indicated at 706 .
  • the process or thread may release the locked access when it no longer requires locked access to the primary store.
  • the process may ‘lazily’ release the locked access; in other words, the process or thread may hold the locked access until receiving a request for release of the locked access.
  • locked access to the primary state may be provided to the other process or thread that requested locked access at 704 .
  • FIG. 5 illustrates a differencing mechanism for providing modified session data to a distributed store according to one embodiment.
  • Application server 104 may include client state 108 .
  • application server 104 may obtain locked access to the primary state 112 included in distributed store 110 .
  • Application server 104 may provide client state 108 to differencing mechanism 302 .
  • application server 104 may provide benchmark client state 300 to the differencing mechanism.
  • distributed store 110 may provide benchmark client state 300 to the differencing mechanism.
  • differencing mechanism 302 may access the benchmark client state 300 from other sources.
  • Differencing mechanism 302 may generate a client state delta 304 between client state 108 and benchmark client state 300 .
  • client state delta 304 may include session data from client state 108 that differs from benchmark client state 300 as determined by the differencing mechanism.
  • differencing mechanism 302 may perform a binary comparison of client state 108 with benchmark client state 300 to generate client state delta 304 .
  • the bits of one set of data are compared to bits of another set of data. In some embodiments, this comparison may be done n bits at a time.
  • the data may be compared byte by byte or alternatively by any n-bit boundary suitable for the data comparison.
  • client state delta 304 may include one or more attributes of the session data that the binary comparison of the data determined to be different between the client state and the benchmark client state.
  • differencing mechanism 302 may use object graph differencing to compare an object graph representation of client state 108 with an object graph representation of benchmark client state 300 to generate client state delta 304 .
  • An object graph may include a directed graph representation of an object's members and descendent members (i.e. members of members). Finding the differences between two objects may include comparing the structure of one object's directed graph representation with the structure of the other object's directed graph representation.
  • client state delta 304 may include one or more attributes of the session data that the object graph comparison of the data determined to be different between the client state and the benchmark client state.
  • an object graph comparison may be used to determine which portions of attributes have been modified. In such an embodiment, only the modified portions of attributes may be used to update the session data saving resources (e.g. network resources) in comparison to using whole attributes to update the session data.
  • differencing methods may be used to generate client state delta 304 .
  • distributed store 110 may use the client state delta 304 to synchronize primary state 112 with client state 108 .
  • the differencing mechanism may be used to determine modified client state attributes and may reduce the load on resources (e.g. the network) by sending modified portions and not sending unmodified portions of the session data to the distributed store 110 during the synchronization process.
  • FIG. 6 illustrates a method for using binary differencing to determine a client state delta according to one embodiment.
  • a client state on an application server may have been modified and thus not be synchronized with the primary state. For example, one or more attributes of the session data in the client state may have been modified.
  • binary differencing may be performed on the client state and a benchmark of the client state to generate a client state delta, as indicated at 750 .
  • the client state may be compared to the benchmark client state n bits at a time to determine which portions (e.g. attributes) differ between the client state and the primary state.
  • the client state delta may include information identifying the one or more attributes of the client state that have been modified as determined by the binary differencing.
  • the primary state may be synchronized with the client state using the identified modified attributes as indicated at 752 .
  • FIG. 7 illustrates a method for using object graph differencing to determine a client state delta according to one embodiment.
  • a client state on an application server may have been modified and thus not be synchronized with the primary state. For example, one or more attributes of the session data in the client state may have been modified.
  • object graph differencing of the client state and a benchmark of the client state may be may be performed to generate a client state delta.
  • the attributes of the session data comprise objects that may be organized according to an object graph representation.
  • An object graph may include a directed graph representation of an object's members and descendent members (i.e. members of members). Finding the differences between two objects may include comparing the structure of one object's directed graph representation with the structure of the other object's directed graph representation.
  • structures of the object graph representation of the client state may be compared to corresponding structures of an object graph representation of the benchmark of the client state to identify the modified attributes of the client state.
  • the client state delta may include information identifying the one or more attributes of the client state that have been modified as determined by the object graph differencing.
  • the primary state may be synchronized with the client state using the identified modified attributes as indicated at 802 .
  • an object graph differencing may determine which portions of attributes have been modified.
  • only the modified portions of attributes may be used to synchronize the primary state with the client state potentially saving resources (e.g. network resources) in comparison to using whole attributes to update the session data.
  • FIGS. 8A and 8B illustrate embodiments of determining accessed attributes of session data.
  • Client state 108 may be a local instance of session data, accessible for read and write access by processes and threads within application server 104 , for example, in response to client interaction with application server 104 .
  • Primary state 112 may be a global instance of the session data accessible by a plurality of application servers.
  • One or more processes on application server 104 may access one or more of attributes 400 of client state 108 .
  • One or more others of attributes 400 may not be accessed.
  • all attributes (accessed or not) may be provided to distributed store 110 to synchronize the primary state with the client state.
  • Other embodiments may track accessed attributes and provide only the accessed attributes to the distributed store. In such embodiments, unaccessed attributes may be unchanged. Thus, saving only the accessed attributes may correctly synchronize the primary state while reducing synchronization overhead as compared to sending all attributes (including unaccessed attributes) to the distributed store during the synchronization process.
  • application server 104 may obtain locked access to primary state 112 on distributed store 110 .
  • Application server 104 may maintain information on which of the attributes 400 of client state 108 have been accessed.
  • information on accessed attributes may be a list of keys or names identifying the accessed attributes 400 B.
  • Application server 104 may provide the tracked accessed attributes 400 B to distributed store 110 for updating the primary state 112 as indicated in FIG. 8A . Attributes that were not accessed do not require updating and thus are not tracked and are not provided to the distributed store. Providing only the accessed attributes to the distributed store for updating of the primary state may reduce the overhead on resources such as network resources caused by synchronizing the primary store and the client state.
  • Some attributes may be immutable attributes (e.g. constants or immutable objects).
  • a set of attributes of a client state may be generated to be used in synchronizing the primary state with the client state, and immutable attributes may be excluded from the set of attributes. The set of attributes may then be provided to the distributed store and used in synchronizing the primary state with the client state.
  • immutable attributes may be excluded during the synchronization process, which may reduce bandwidth usage and/or other resource usage during the synchronization process.
  • attributes that were not accessed may also be excluded from the set of attributes.
  • attributes that were accessed only with an immutable access may also be excluded from the set of attributes.
  • immutable attributes may include one or more attributes which have been designated as immutable attributes in response to user input.
  • application server 104 may distinguish between mutable accesses to the session data and immutable accesses to the session data.
  • a write access may be a mutable access
  • a read access may be an immutable access.
  • only attributes that were mutably accessed may be tracked and provided to the distributed store, and thus attributes that were only immutably accessed may be excluded during the synchronization process, which may reduce bandwidth usage and/or other resource usage during the synchronization process.
  • Some attributes of the session data may be classified as mutable (e.g. writable) attributes.
  • a mutable attribute may be marked as being modified in response to any access to that attribute.
  • a mutable attribute may be marked as modified in response to a write access, but not in response to a read access.
  • Other attributes may be classified as immutable (read-only).
  • immutable accesses are not tracked and thus not provided to the distributed store during the synchronization process.
  • Other attributes may not be classified (e.g. as mutable or immutable). Such attributes may be tracked only if mutably accessed.
  • the attributes may be provided to a differencing mechanism 302 that may determine which of the provided attributes have been modified. In one embodiment, all attributes may be provided to the differencing mechanism. In another embodiment, attributes may be tracked according to one of or according to a combination of the tracking techniques described above, and only the tracked attributes may be provided to the differencing mechanism. For example, in one embodiment only accessed attributes are provided to the differencing mechanism, which may then determine which of the accessed attributes were actually modified. In yet another embodiment, mutably accessed attributes may be tracked, and only the mutably accessed attributes may be provided to the differencing mechanism, which may then determine which of the mutably accessed attributes were actually modified. In still yet another embodiment, accessed mutable attributes may be tracked, and only the accessed mutable attributes may be provided to the differencing mechanism, which may then determine which of the accessed mutable attributes were actually modified.
  • differencing mechanism 302 may use a binary differencing method to compare the provided attributes to a set of benchmark attributes to determine the modified attributes. In another embodiment, differencing mechanism 302 may use an object graph differencing method to compare the provided attributes to a set of benchmark attributes to determine the modified attributes and/or modified portions of attributes. In other embodiments, differencing mechanism 302 may use other methods to determine the modified attributes.
  • Differencing mechanism 302 may provide the determined modified attributes to distributed store 110 for updating primary state 112 .
  • Differencing mechanism 302 may allow modified attributes to be identified so that the load on resources (e.g. the network) may be reduced by sending only modified portions and not unmodified portions of the session data to the distributed store 110 during the synchronization process.
  • FIG. 9 illustrates a method of tracking accessed attributes, according to one embodiment.
  • the application serve may include a client state.
  • the client state may be a local instance of session data, accessible by processes and threads within the application server, for example, in response to client interaction with the application server.
  • a distributed store may include a primary state of the session data.
  • the primary state may be a global instance of the session data accessible by a plurality of application servers.
  • One or more attributes of the session data may be accessed, as indicated at 850 , for example by processes and/or threads within an application server.
  • the attributes of the client state that are accessed may be tracked, for example by a state manager component of the application server.
  • a list of keys or names identifying the accessed attributes may be kept.
  • the application server may distinguish between mutable accesses to the session data and immutable accesses to the session data. For example, a write access may be a mutable access, and a read access may be an immutable access.
  • only attributes that were mutably accessed may be tracked.
  • some attributes of the session data may be classified as mutable attributes. Any access to a mutable attribute may result in the attribute being marked or listed as being modified. Other attributes may be classified as immutable. In one embodiment, immutable attributes are not tracked.
  • the tracked accessed attributes may be provided to the distributed store, as indicated at 854 .
  • the tracked accessed attributes may be compared to an original or benchmark version of the attributes to determine which of the tracked accessed attributes were actually modified. In one embodiment, this comparison may employ a binary differencing method to compare the provided attributes to a set of benchmark attributes to determine the modified attributes. In another embodiment, an object graph differencing method may be employed to compare the provided attributes to a set of benchmark attributes to determine the modified attributes and/or modified portions of attributes.
  • the primary state and the client state may then be synchronized using the modified attributes and/or modified portions of attributes, as indicated at 856 .
  • FIG. 10 illustrates a method for providing attributes to a distributed store during synchronization of a primary state with a client state, according to one embodiment.
  • a client state of session data may be accessed, as indicated at 900 , for example by one or more processes executing within an application server.
  • information may be maintained on which of the attributes of the session data have been accessed.
  • the information on accessed attributes may include a list of keys or names identifying the accessed attributes.
  • the method may include determining which attributes were modified as indicated at 902 .
  • a differencing component of the application server may determine which attributes were modified.
  • a binary differencing method may be used to compare the client state attributes to a benchmark or original of the attributes to determine the modified attributes.
  • an object graph differencing method may be used to compare the client state attributes to a benchmark of the attributes to determine the modified attributes.
  • other methods to determine the modified attributes.
  • the method used to determine which attributes have been modified (binary diff, object graph diff, etc.) may applied to only certain attributes. For example, in one embodiment, the only the accessed attributes are checked for changes since unaccessed attributes presumably were not changed.
  • attribute that were not accessed by a mutable access are also eliminated from the determination process.
  • only the mutably accessed attributes are checked to determine which of the mutably accessed attributes were actually modified.
  • only attributes classified as mutable are checked for changes. Attributes classified as immutable may be eliminated from the determination process. Mutable attributes that have not been accessed or that have been accessed by a non-mutable access (e.g.) may also be eliminated (not checked) when determining which of the accessed mutable attributes were actually modified.
  • the method may then include synchronizing a corresponding primary state (e.g. in a distributed store) with the client state using the modified attributes, as indicated at 904 .
  • a corresponding primary state e.g. in a distributed store
  • the client state using the modified attributes, as indicated at 904 .
  • only the attributes determined to have been modified are used for the synchronizing.
  • unmodified client state attributes need not be sent when updating the corresponding primary state in a distributed store.
  • FIG. 11 illustrates a distributed store node using a differencing mechanism to synchronize instances of a primary state to a back-up node, according to one embodiment.
  • Distributed store node 110 A may include a primary state 112 of session data.
  • distributed store node 110 A is part of or associated with one of one or more application servers in a distributed or clustered system.
  • the primary state may be distributed across multiple stores (e.g. computer-accessible mediums and/or other systems).
  • Back-up node 506 may be another distributed store node associated with another application server in the system.
  • back-up node 506 may be part of a backend system or a dedicated back-up system.
  • One or more additional instances of the primary state may serve as backup copies of the primary state and may themselves be stored on different nodes of the distributed store system, or alternatively on other systems and/or backend systems. In one embodiment, these other instances of the primary state may be distributed across multiple computer-accessible mediums and/or other systems. It may be necessary or desirable to maintain synchronization between the various instances of the primary state.
  • distributed store node 110 A may retain a benchmark state 500 .
  • This benchmark state 500 may be a copy of or otherwise indicate a back-up instance of the primary state on one or more other nodes.
  • benchmark state 500 may be stored elsewhere and be provided to or accessed by the differencing mechanism 502 .
  • Differencing mechanism 502 may generate a primary state delta 504 between primary state 112 and the benchmark state 500 .
  • Primary state delta 504 may indicate differences in session data between the primary state 112 and the benchmark state 500 .
  • differencing mechanism 502 may perform a binary comparison of primary state 112 with benchmark state 500 to generate primary state delta 504 .
  • the bits of one set of data are compared to the bits of the other set of data. In one embodiment, this comparison may be done n bits at a time.
  • the data may be compared byte by byte or alternatively by any n-bit boundary suitable for the data.
  • primary state delta 504 may include one or more attributes of the session data that the binary comparison determined to be different between the primary state 112 and the benchmark primary state 500 .
  • differencing mechanism 502 may use object graph differencing to compare an object graph representation of primary state 112 with an object graph representation of benchmark primary state 500 to generate primary state delta 504 .
  • An object graph may include a directed graph representation of an object's members and descendent members (i.e. members of members). Finding the differences between two objects may include comparing the structure of one object's directed graph representation with the structure of the other object's directed graph representation.
  • primary state delta 504 may include one or more attributes of the session data that the object graph comparison determined to be different between the primary state 112 and the benchmark primary state 500 .
  • primary state delta 504 may include one or more portions of attributes of the session data that the object graph comparison determined to be different between the primary state 112 and the benchmark primary state 500 .
  • differencing mechanism 502 may use other methods to generate primary state delta 504 .
  • the comparison may be simplified by eliminating from the comparison attributes and/or portions of attributes of the primary state classified as immutable attributes.
  • distributed store node 110 A may provide primary state delta 504 to back-up node 506 , and back-up node 506 may synchronize its instance of the primary state data 508 with the primary state 112 using primary state delta 504 .
  • the differencing mechanism 502 may provide a mechanism for obtaining modified attributes so that the load on resources (e.g. the network) may be reduced by sending only the modified and not the unmodified portions of the session data to the backend system 506 .
  • differencing mechanism 502 instead of comparing the primary state 112 to a benchmark state 500 , eliminate immutable attributes from the primary state 112 and supply the remaining attributes as primary state deltas 504 .
  • other instances of the primary state may be synchronized using the primary state delta 504 provided by the differencing mechanism 502 . Synchronizing the other instances of the primary state using the primary state may use fewer resources, such as network bandwidth, than sending the entire primary state during the synchronizing process. Alternatively, other instances of the primary state may be replaced or synchronized as described above with the newly synchronized instance from the back-up node 506 . Other embodiments may use other methods to synchronize the other instances.
  • FIG. 12 illustrates a method for updating one or more back-up instances of a primary state using binary differencing to determine a primary state delta according to one embodiment.
  • a binary comparison of the primary state and a benchmark of the primary state may be performed to generate a primary state delta, as indicated at 950 .
  • the bits of the primary state may be compared to the bits of the benchmark primary state n bits at a time to determine modified attributes.
  • the primary state delta may include one or more attributes of the session data that the binary comparison determined to be different between the primary state and the benchmark primary state.
  • the primary state delta may be used to synchronize the back-up instances of the primary state on one or more back-up nodes, as indicated at 952 .
  • one or more instance of the primary state may be synchronized using the primary state delta, and one or more other instances of the primary state may be replaced with one of the newly synchronized instance.
  • FIG. 13 illustrates a method for updating instances of a primary state using object graph differencing to determine a primary state delta, according to one embodiment.
  • the method may include performing an object graph comparison of the primary state and a benchmark of the primary state to generate a primary state delta, as indicated at 976 .
  • the object graph comparison may find the differences between the primary state and the benchmark primary state by traversing and comparing an object graph representation of the primary state with an object graph representation of the benchmark primary state.
  • An object graph may include a directed graph representation of an object's members and descendent members (i.e. members of members).
  • the primary state delta may include one or more attributes and/or portions of attributes of the session data that the object graph comparison determines to be different between the primary state and the benchmark of the primary state.
  • the primary state delta may be used to synchronize other instances of the primary state, as indicated at 978 .
  • the primary state delta may be sent to one or more back-up nodes of a distributed store.
  • FIG. 14 illustrates a method of accessing and synchronizing state data according to one embodiment.
  • a process executing on an application server may obtain locked access to a primary state of session data on a distributed store, as indicated at 980 .
  • threads of the process may obtain more atomic locked access on the primary state.
  • the process and/or the threads may access the primary state, and the application server may track mutable accesses (e.g. reads from mutable attributes and writes to any attributes) to the session data as indicated at 982 .
  • the application server may maintain a list of keys or names of attributes that have been mutably accessed, and the application server may provide the list to the object graph differencing method.
  • accessed mutable attributes may be tracked, and only the accessed mutable attributes may be provided to the differencing mechanism, which may then determine which of the accessed mutable attributes were actually modified.
  • the application server may provide the tracked mutably accessed attributes to an object graph differencing mechanism.
  • the application server may provide a benchmark session data to the object graph differencing mechanism.
  • the object graph differencing mechanism may access the benchmark session data from other sources.
  • An object graph comparison may be performed of an object graph representation of the mutably accessed attributes with an object graph representation of the benchmark session data to determine the modified attributes and/or modified portions of attributes, as indicate at 984 .
  • the modified attributes and/or modified portions of attributes may be synchronized to a distributed store, as indicated at 986 .
  • the distributed store may update the primary state using the modified attributes.
  • Using embodiments of the method illustrated in FIG. 14 may help prevent data loss and maintain synchronization between instances of state data of while preferably reducing the overhead of the synchronization process.
  • embodiments of the system and method are described herein in respect to enterprise systems and/or application servers, it is noted that embodiments of the system and method may be used in various other application areas that require synchronization of data. For example, embodiments of the system and method may be applicable in peer-to-peer networks or other Internet client/server applications. In general, embodiments of the system and method as described herein may be used in any of a variety of environments that require synchronization of data.
  • a computer-accessible medium or article of manufacture may include storage media or memory media such as magnetic or optical media, e.g., disk or CD-ROM, volatile or non-volatile media such as RAM (e.g. SDRAM, DDR SDRAM, RDRAM, SRAM, etc.), ROM, etc. as well as transmission media or signals such as electrical, electromagnetic, or digital signals, conveyed via a communication medium such as network and/or a wireless link.
  • storage media or memory media such as magnetic or optical media, e.g., disk or CD-ROM, volatile or non-volatile media such as RAM (e.g. SDRAM, DDR SDRAM, RDRAM, SRAM, etc.), ROM, etc.
  • RAM e.g. SDRAM, DDR SDRAM, RDRAM, SRAM, etc.
  • ROM etc.
  • transmission media or signals such as electrical, electromagnetic, or digital signals

Abstract

A client-server system may include a primary state of session data. Application servers may include client states of the session data and may access the primary state. The session data may include attributes. The distributed store may provide locked access to the primary state to processes executing within the application servers. While one process has locked access, other processes are not allowed to access the primary state. In one embodiment, the distributed store provides locked access to portions of the primary state to threads executing within a process with locked access. While a portion of the primary state is locked for a thread, other threads cannot access the portion. In one embodiment, the distributed store may request the process to release the locked access. The process may release the locked access in response to the request. In one embodiment, the process may release the locked access when no longer needed.

Description

BACKGROUND OF THE INVENTION
1. Field of the Invention
This invention relates to providing quality of service in a networked environment, and more particularly to a quality of service mechanism for lock mechanisms to address data clobbering in distributed data systems.
2. Description of the Related Art
In the client server environment, a session may include a series of user-application interactions that may be tracked by one or more servers. Sessions may be used for maintaining user-specific states, and may include persistent objects (e.g. handles to Enterprise Java Beans and/or database record sets) and authenticated user identities, among other interactions. For example, a session may be used to track a validated user login followed by a series of directed activities for that particular user. The session may reside in a server. For each request, a client may transmit a session ID in a cookie or, if the client does not allow cookies, the server may automatically write a session ID into a URL. The session ID may be used as a database key to access persistent objects associated with the client. Types of sessions may include, but are not limited to, distributed sessions and local sessions. Distributed sessions may be distributed among multiple servers, for example in a cluster, whereas local sessions may be bound to an individual server.
Distributed sessions may facilitate scalability, fail-safe techniques, and security. For example, a web server may distribute activity to remain scalable with respect to network traffic. Thus, a complete description (referred to as “session data”) of a distributed session may include state information for each process and/or computing system over which the session is distributed. For example, session data may include a snapshot of a session between a web browser and a web server may include one or more of the state of the web browser process(es), the state of the computing system hosting the web browser, the state of the web server process(es), the state of the computing system hosting the web server, the state of the computing system hosting an application server providing content to the web server, the sate of the application server process(es), and the state of one or more applications, processes and/or threads hosted by the application server or optionally on any other system involved in the distributed session.
For a distributed session, a primary state and one or more client states may be maintained. The primary state may be defined as a global instance of session data accessible by one or more application servers. A client state may be defined as a local instance of session data on an application server. The client state may include session data from internal or external client interaction with the application server. For example, the client may include, but is not limited to, a process, a thread within a process, or an application running on one or more external or internal devices and/or computing systems. The client states may serve as interfaces between clients, application servers, and the primary state, and may provide read and/or write access to the primary state to the application servers.
Client-server applications may store distributed session information as snapshots of the states of participating processes, resources, and computing systems to minimize data loss in case of failure. Current techniques for storing state information from distributed sessions may result in inconsistent primary state data and consume significant amounts of resources.
Client state information may be retrieved and written by multiple servers at the same time resulting in data loss. For example, an application on one server may access session data in a primary state, while another application on another server accesses the same session data. Then, the first application may update the session data. The second application may update the session data after the first application. Portions of the session data updated by the first application may be overwritten, resulting in loss of data. This data loss may be referred to as “data clobbering.”
State information involving multiple applications and servers across a network may consume significant network resources. To update and/or backup state information, a large amount of data may be sent to one or more network storage mediums thereby consuming network bandwidth and other resources. Restoring state information from one or more network storage mediums may consume bandwidth and other resources as well. Bandwidth and resource intensive state save operations may result in delays in servicing requests. Such delays may adversely affect the quality of service of the application.
SUMMARY OF THE INVENTION
A client-server system may include a distributed store configured to maintain a primary state of session data. The system may also include one or more application servers that each may include a client state of the session data for access by clients of the system. The session data may include one or more attributes.
The distributed store may provide locked access to the primary state to a process executing within one of the application servers. While the primary state is locked for the process, other processes may not access the primary state. In one embodiment, the distributed store may provide locked access to portions of the primary state to threads executing within the process. While a thread has locked access to a portion of the primary state, other threads executing within the process cannot access the portion of the primary state.
In one embodiment, while a process holds locked access to the primary state, the distributed store may buffer requests for locked access from other processes executing within one or more of the application servers. In one embodiment, the distributed store may request that the process release the locked access. The process may release the locked access in response to said request. In another embodiment, the process may release the locked access when the process no longer requires locked access to the primary state.
Another process waiting for locked access may suspend execution until locked access to the primary state is granted to the process. In one embodiment, one or more threads of the process may continue execution until locked access to the primary state is granted to the process. When the process releases the locked access to the primary state, the distributed store may provide locked access to one of the other processes in response to the other process's buffered request.
BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 illustrates an exemplary enterprise information system (EIS) with distributed session data according to one embodiment.
FIGS. 2A, 2B, and 2C illustrate a locking mechanism for controlling access to a primary state according to one embodiment.
FIG. 3 illustrates a method for providing locked access to a primary state of session data according to one embodiment.
FIG. 4 illustrates a method for providing locked access to a primary state according to one embodiment.
FIG. 5 illustrates a differencing mechanism for providing modified session data to a distributed store according to one embodiment.
FIG. 6 illustrates a method for using binary differencing to determine a client state delta according to one embodiment.
FIG. 7 illustrates a method for using object graph differencing to determine a client state delta according to one embodiment.
FIGS. 8A and 8B illustrate embodiments of determining accessed attributes of session data.
FIG. 9 illustrates embodiments of a method of tracking accessed attributes. In one embodiment, the application server may include a client state.
FIG. 10 illustrates embodiments of a method of providing attributes to a distributed store according for synchronization of a primary state with a client state.
FIG. 11 illustrates a distributed store using a differencing mechanism to synchronize instances of a primary state according to one embodiment.
FIG. 12 illustrates a method for updating instances of a primary state using binary differencing to determine a primary state delta according to one embodiment.
FIG. 13 illustrates a method for updating instances of a primary state using object graph differencing to determine a primary state delta according to one embodiment.
FIG. 14 illustrates a method of accessing and synchronizing state data according to one embodiment.
While the invention is described herein by way of example for several embodiments and illustrative drawings, those skilled in the art will recognize that the invention is not limited to the embodiments or drawings described. It should be understood, that the drawings and detailed description thereto are not intended to limit the invention to the particular form disclosed, but on the contrary, the intention is to cover all modifications, equivalents and alternatives falling within the spirit and scope of the present invention as defined by the appended claims. The headings used herein are for organizational purposes only and are not meant to be used to limit the scope of the description or the claims. As used throughout this application, the word “may” is used in a permissive sense (i.e., meaning having the potential to), rather than the mandatory sense (i.e., meaning must). Similarly, the words “include”, “including”, and “includes” mean including, but not limited to.
DETAILED DESCRIPTION OF EMBODIMENTS OF THE INVENTION
FIG. 1 illustrates an exemplary enterprise information system (EIS) with distributed session data according to one embodiment. Enterprise server 102 may include one or more servers (e.g. web servers) that provide content to the clients 100 over network 10. Network 10 may be a wired or wireless network or a combination thereof, and may include a LAN, WAN, Internet, or a combination thereof. Any of a variety of one or more networking protocols may be used in the network, for example, TCP/IP. Application servers 104A and 104B may include processes 106A and 106B respectively that may be used by the clients 100 to apply business logic to enterprise data. Application servers 104A and 104B may include client states 108A and 108B respectively. Clients 100A, 100B, and 100C may be any of a variation of devices such as desktop personal computers, laptops, PDAs, and point-of-sale terminals running client applications such as web browsers.
Session data may include, but is not limited to, information related to environmental attributes, processes, and client-server interaction. For example, clients 100 may include web browsers accessing content generated by applications of application servers 104. The client states 108 are local instances of session data maintained by the application servers, for example, for use by clients of the application servers or by processes executing within the application servers. Distributed store 110 may store persistent data including one or more instances of primary state 112. Primary state 112 may include an instance of the session data that is globally accessible by the application servers. In one embodiment, primary state 112 may be distributed on the network across one or more computer-accessible mediums (e.g. RAID systems and/or database systems). In one embodiment, one or more instances or copies of primary state 112 may be maintained on one or more backend systems that may serve as, for example, backup systems and/or fail-over systems. In one embodiment, distributed store 110 may include storage on one or more computer systems that also host one or more of application servers 104.
The clients 100 may access enterprise server 102 via network 10. Enterprise server 102 may be implemented or clustered across one or more of the same computer systems as application servers 104, or on one or more separate computer systems. Enterprise server 102 may serve as a front end to the application servers for the clients 100. A client 100 may access enterprise server 102 during a session or during multiple sessions. In one embodiment, the applications and/or processes within the application servers may provide data and/or services to enterprise server 102, for example, for use by the clients. The application server may send updates of session data to distributed store 110 in response to an event such as a modification of one or more attributes of a client state 108 and/or as routine maintenance to synchronize the primary state with the client states. An attribute may be a portion or element of the session data, and may be one of any of various types of data that may be used in a session such as programming language objects or classes (e.g. Java objects or classes), strings, integers, Booleans, characters, real number representations, or any other type of computer-representable data.
In one embodiment, to access session data, a process 106 executing within an application server 104 may request a lock (e.g. mutex lock) of the primary state from distributed store 110. If another process does not currently have the primary state locked, distributed store 110 may issue the lock to the requesting process 106. If another process has the primary state locked, the process requesting the lock may enter a wait state or alternatively may continue executing another task while waiting for the lock. In one embodiment, a ‘lazy’ locking mechanism may be used in which when the process no longer requires locked access, the process does not release the lock immediately but may instead wait for a request for the lock. For example, the distributed store may request the lock from a process holding the lock in response to another process requesting a lock of the primary state.
In one embodiment, access to the primary state may be locked to allow a process or thread access to the primary state while blocking access to the primary state by other processes or threads. In one embodiment, locking of the primary state may be provided by a data synchronization mechanism.
In one embodiment, the process of locking the primary state may include obtaining a token. The token may include, but is not limited to, a string or a numeric identifier. A process or thread may request locked access to the primary state from a locking mechanism. The locking mechanism may send a reply message to the process or thread including a token. The process or thread may access the primary state after receiving the token. The process or thread may release the lock on the primary state by sending a release message to the locking mechanism including the token. A process or thread that does not hold a token may not be allowed access to the primary state until the process or thread requests and receives the token.
In one embodiment, a global lock may be provided at the process level and atomic locks may be provided at the thread level. A global lock may be used to restrict concurrent access to the primary state at the process level. The threads within the process having the global lock may use a thread-level lock to restrict access to portions of the session data of the primary state to a thread within the process holding the global lock. The thread-level lock may block other threads within the process from concurrently accessing the locked portion of the session data. The other threads may continue executing and one or more other threads within the process may lock other portions of the session data while the first thread is holding the lock on the first portion of the session data unless they require access to the portions of the session data that are locked at the thread level, at which point a thread may enter a wait state to wait for the thread holding the lock to release the lock.
FIGS. 2A, 2B, and 2C illustrate a locking mechanism for controlling access to a primary state according to one embodiment. In FIG. 2A, a process requests locked access to a primary state of session data on a distributed store. A process 104 may request locked access to primary state 112, for example, to update the primary state with modified session data. Distributed store 110 may issue a lock to the requesting process in response to the request.
In one embodiment, a lock may be required for every access to the primary state 112. Using the lock, a process 104 may prevent other processes and/or threads on the application server or other application servers from accessing the primary state. The lock may be obtained and released on an access-by-access basis such that each time a process needs to access the primary state it must first obtain the lock for that primary state and then release the lock upon completion of its access. In another embodiment, after a process obtains a lock for a primary state, it may continue to hold the lock after it has completed accessing the corresponding primary state. For example, in such an embodiment, the process holding the lock may not release the lock until after the it is requested to release the lock (e.g. by another process or by the distributed store manager). By holding the lock, a process that frequently access the same primary state may reduce its amount of lock requests.
Another embodiment may provide a global locking mechanism at the process level and a thread-level locking mechanism for threads within a process currently holding a global lock of the primary state. The thread-level lock may allow threads to perform atomic-level locking of the session data. The global/thread level locking mechanism may decrease the blocking that may be caused by per-access locking. Locking for individual thread-level access of the corresponding primary state may be handled more efficiently within the process and thus reduce the amount of process-level lock requests.
Another process 104B executing within the same or a different application server, at some point, may request locked access to primary state 112. If process 104A has primary state 112 locked, distributed store 110 may hold (e.g. queue) the request 208. In FIG. 2B, process 104B, or alternatively one or more threads within process 104B that requested the lock, may be blocked and thus may be in a wait state until the lock is granted.
In FIG. 2C, application server 104A releases the lock, and locked access is provided to process 104B. In one embodiment, process 104A may release the lock when done accessing primary state 112. In another embodiment, a ‘lazy’ release strategy may be used, wherein process 104A holds the lock until requested to release the lock. For example, distributed store 110 may request the lock from process 104A in response to receiving the request for locked access from process 104B. In one embodiment, process 104A may notify distributed store 110 of the release of the lock. In one embodiment, a lock release message may be sent from the process to the distributed store.
FIG. 3 illustrates a method for providing locked access to a primary state of session data according to one embodiment. A process or thread may require access to a primary state of session data, and to protect the primary state from concurrent access by other processes or threads, the process or thread may request locked access to the primary state as indicated at 600. For example, a client state of the session data on an application server may have been modified, and a process may request locked access to the primary state to synchronize the primary state with the client state on the application server.
If another process or thread does not have the primary state locked, locked access may be provide to the requesting process or thread as indicated at 602. In one embodiment, the locked access may be provided by sending a token to the requesting process or thread. While holding the locked access, the process or thread may access the primary state as indicated at 604, and other processes or threads may not be allowed access to the primary state. Using the locking mechanism, data loss and/or incoherent data that may result from other processes and/or threads concurrently accessing the primary state of the session data may be prevented.
In one embodiment, locked access may be granted globally at the process level and thus may prevent any other process or thread from accessing the primary state while the process holds the locked access. In another embodiment, locked access may be granted globally at the process level and locally at the thread level for threads of a process currently holding the process level lock, thus allowing for atomic locking of portions of the session data of the primary state by threads within the process. In one embodiment, process-level locked access may be managed through a distributed store data synchronization layer (e.g. distributed store manager) and the thread-level locked access may be managed within a process that holds the global lock. Thread-level locked access may allow threads within the process currently holding the global lock to lock the session data at a more atomic level, as opposed to the global lock which locks the entire primary state. Thread-level locked access may be used to prevent threads within the process from concurrently accessing locked portions of the session data. In one embodiment, one or more threads within the process may lock other portions of the session data while a first thread is holding locked access on a first portion of the session data. In one embodiment, if a thread requires access to a locked portion of the session data, the thread may enter a wait state to wait for the locked access to be released.
FIG. 4 illustrates a method for providing locked access to a primary state according to one embodiment. A request for locked access to the primary state may be received from a process or thread as indicated at 700. If another process or thread does not currently hold locked access, locked access to the primary state may be provided to the requesting process or thread as indicated at 702. Another request for locked access may be received from another process or thread as indicated at 704. If the first process or thread currently holds locked access to the primary state, locked access may not be immediately granted to the other process or thread, but instead, the request may be held awaiting release of the locked access by the process or thread. In one embodiment, a request for locked access that is not immediately granted may be buffered with other pending requests for locked access, if any.
When the process or thread holding the locked access no longer requires locked access, the process or thread may release the locked as indicated at 706. In some embodiments, the process or thread may release the locked access when it no longer requires locked access to the primary store. In other embodiments, the process may ‘lazily’ release the locked access; in other words, the process or thread may hold the locked access until receiving a request for release of the locked access. As indicated at 708, after the locked access is released by the process or thread, locked access to the primary state may be provided to the other process or thread that requested locked access at 704.
FIG. 5 illustrates a differencing mechanism for providing modified session data to a distributed store according to one embodiment. Application server 104 may include client state 108. In one embodiment, application server 104 may obtain locked access to the primary state 112 included in distributed store 110. Application server 104 may provide client state 108 to differencing mechanism 302. In one embodiment, application server 104 may provide benchmark client state 300 to the differencing mechanism. In other embodiments, distributed store 110 may provide benchmark client state 300 to the differencing mechanism. In yet other embodiments, differencing mechanism 302 may access the benchmark client state 300 from other sources. Differencing mechanism 302 may generate a client state delta 304 between client state 108 and benchmark client state 300. In one embodiment, client state delta 304 may include session data from client state 108 that differs from benchmark client state 300 as determined by the differencing mechanism.
In one embodiment, differencing mechanism 302 may perform a binary comparison of client state 108 with benchmark client state 300 to generate client state delta 304. In performing a binary comparison, the bits of one set of data are compared to bits of another set of data. In some embodiments, this comparison may be done n bits at a time. For example, the data may be compared byte by byte or alternatively by any n-bit boundary suitable for the data comparison. In one embodiment, client state delta 304 may include one or more attributes of the session data that the binary comparison of the data determined to be different between the client state and the benchmark client state.
In another embodiment, differencing mechanism 302 may use object graph differencing to compare an object graph representation of client state 108 with an object graph representation of benchmark client state 300 to generate client state delta 304. An object graph may include a directed graph representation of an object's members and descendent members (i.e. members of members). Finding the differences between two objects may include comparing the structure of one object's directed graph representation with the structure of the other object's directed graph representation. In one embodiment, client state delta 304 may include one or more attributes of the session data that the object graph comparison of the data determined to be different between the client state and the benchmark client state. In one embodiment, an object graph comparison may be used to determine which portions of attributes have been modified. In such an embodiment, only the modified portions of attributes may be used to update the session data saving resources (e.g. network resources) in comparison to using whole attributes to update the session data.
In other embodiments, other differencing methods may be used to generate client state delta 304. After differencing mechanism 302 generates client state delta 304, distributed store 110 may use the client state delta 304 to synchronize primary state 112 with client state 108. The differencing mechanism may be used to determine modified client state attributes and may reduce the load on resources (e.g. the network) by sending modified portions and not sending unmodified portions of the session data to the distributed store 110 during the synchronization process.
FIG. 6 illustrates a method for using binary differencing to determine a client state delta according to one embodiment. A client state on an application server may have been modified and thus not be synchronized with the primary state. For example, one or more attributes of the session data in the client state may have been modified.
As indicated at 750, binary differencing may be performed on the client state and a benchmark of the client state to generate a client state delta, as indicated at 750. In binary differencing, the client state may be compared to the benchmark client state n bits at a time to determine which portions (e.g. attributes) differ between the client state and the primary state. The client state delta may include information identifying the one or more attributes of the client state that have been modified as determined by the binary differencing. The primary state may be synchronized with the client state using the identified modified attributes as indicated at 752.
FIG. 7 illustrates a method for using object graph differencing to determine a client state delta according to one embodiment. A client state on an application server may have been modified and thus not be synchronized with the primary state. For example, one or more attributes of the session data in the client state may have been modified.
As indicated at 800, object graph differencing of the client state and a benchmark of the client state may be may be performed to generate a client state delta. In one embodiment, the attributes of the session data comprise objects that may be organized according to an object graph representation. An object graph may include a directed graph representation of an object's members and descendent members (i.e. members of members). Finding the differences between two objects may include comparing the structure of one object's directed graph representation with the structure of the other object's directed graph representation. In performing object graph differencing, structures of the object graph representation of the client state may be compared to corresponding structures of an object graph representation of the benchmark of the client state to identify the modified attributes of the client state. The client state delta may include information identifying the one or more attributes of the client state that have been modified as determined by the object graph differencing. The primary state may be synchronized with the client state using the identified modified attributes as indicated at 802. In one embodiment, an object graph differencing may determine which portions of attributes have been modified. In such an embodiment, only the modified portions of attributes may be used to synchronize the primary state with the client state potentially saving resources (e.g. network resources) in comparison to using whole attributes to update the session data.
FIGS. 8A and 8B illustrate embodiments of determining accessed attributes of session data. Client state 108 may be a local instance of session data, accessible for read and write access by processes and threads within application server 104, for example, in response to client interaction with application server 104. Primary state 112 may be a global instance of the session data accessible by a plurality of application servers. One or more processes on application server 104 may access one or more of attributes 400 of client state 108. One or more others of attributes 400 may not be accessed. In one embodiment, all attributes (accessed or not) may be provided to distributed store 110 to synchronize the primary state with the client state. Other embodiments may track accessed attributes and provide only the accessed attributes to the distributed store. In such embodiments, unaccessed attributes may be unchanged. Thus, saving only the accessed attributes may correctly synchronize the primary state while reducing synchronization overhead as compared to sending all attributes (including unaccessed attributes) to the distributed store during the synchronization process.
In one embodiment, as illustrated in FIG. 8A, during the synchronization process, application server 104 may obtain locked access to primary state 112 on distributed store 110. Application server 104 may maintain information on which of the attributes 400 of client state 108 have been accessed. In one embodiment, information on accessed attributes may be a list of keys or names identifying the accessed attributes 400B. Application server 104 may provide the tracked accessed attributes 400B to distributed store 110 for updating the primary state 112 as indicated in FIG. 8A. Attributes that were not accessed do not require updating and thus are not tracked and are not provided to the distributed store. Providing only the accessed attributes to the distributed store for updating of the primary state may reduce the overhead on resources such as network resources caused by synchronizing the primary store and the client state.
Some attributes may be immutable attributes (e.g. constants or immutable objects). In one embodiment, a set of attributes of a client state may be generated to be used in synchronizing the primary state with the client state, and immutable attributes may be excluded from the set of attributes. The set of attributes may then be provided to the distributed store and used in synchronizing the primary state with the client state. Thus, immutable attributes may be excluded during the synchronization process, which may reduce bandwidth usage and/or other resource usage during the synchronization process. In one embodiment, attributes that were not accessed may also be excluded from the set of attributes. In one embodiment, attributes that were accessed only with an immutable access may also be excluded from the set of attributes. In one embodiment, immutable attributes may include one or more attributes which have been designated as immutable attributes in response to user input.
In one embodiment, application server 104 may distinguish between mutable accesses to the session data and immutable accesses to the session data. For example, a write access may be a mutable access, and a read access may be an immutable access. In this embodiment, only attributes that were mutably accessed may be tracked and provided to the distributed store, and thus attributes that were only immutably accessed may be excluded during the synchronization process, which may reduce bandwidth usage and/or other resource usage during the synchronization process.
Some attributes of the session data may be classified as mutable (e.g. writable) attributes. In one embodiment, a mutable attribute may be marked as being modified in response to any access to that attribute. Alternatively, a mutable attribute may be marked as modified in response to a write access, but not in response to a read access. Other attributes may be classified as immutable (read-only). In one embodiment, immutable accesses are not tracked and thus not provided to the distributed store during the synchronization process. Other attributes may not be classified (e.g. as mutable or immutable). Such attributes may be tracked only if mutably accessed.
In one embodiment, as illustrated in FIG. 8B, the attributes may be provided to a differencing mechanism 302 that may determine which of the provided attributes have been modified. In one embodiment, all attributes may be provided to the differencing mechanism. In another embodiment, attributes may be tracked according to one of or according to a combination of the tracking techniques described above, and only the tracked attributes may be provided to the differencing mechanism. For example, in one embodiment only accessed attributes are provided to the differencing mechanism, which may then determine which of the accessed attributes were actually modified. In yet another embodiment, mutably accessed attributes may be tracked, and only the mutably accessed attributes may be provided to the differencing mechanism, which may then determine which of the mutably accessed attributes were actually modified. In still yet another embodiment, accessed mutable attributes may be tracked, and only the accessed mutable attributes may be provided to the differencing mechanism, which may then determine which of the accessed mutable attributes were actually modified.
In one embodiment, differencing mechanism 302 may use a binary differencing method to compare the provided attributes to a set of benchmark attributes to determine the modified attributes. In another embodiment, differencing mechanism 302 may use an object graph differencing method to compare the provided attributes to a set of benchmark attributes to determine the modified attributes and/or modified portions of attributes. In other embodiments, differencing mechanism 302 may use other methods to determine the modified attributes.
Differencing mechanism 302 may provide the determined modified attributes to distributed store 110 for updating primary state 112. Differencing mechanism 302 may allow modified attributes to be identified so that the load on resources (e.g. the network) may be reduced by sending only modified portions and not unmodified portions of the session data to the distributed store 110 during the synchronization process.
FIG. 9 illustrates a method of tracking accessed attributes, according to one embodiment. The application serve may include a client state. The client state may be a local instance of session data, accessible by processes and threads within the application server, for example, in response to client interaction with the application server. A distributed store may include a primary state of the session data. The primary state may be a global instance of the session data accessible by a plurality of application servers.
One or more attributes of the session data may be accessed, as indicated at 850, for example by processes and/or threads within an application server. As indicated at 852, the attributes of the client state that are accessed may be tracked, for example by a state manager component of the application server. In one embodiment, a list of keys or names identifying the accessed attributes may be kept. In another embodiment, the application server may distinguish between mutable accesses to the session data and immutable accesses to the session data. For example, a write access may be a mutable access, and a read access may be an immutable access. In this embodiment, only attributes that were mutably accessed may be tracked. In yet another embodiment, some attributes of the session data may be classified as mutable attributes. Any access to a mutable attribute may result in the attribute being marked or listed as being modified. Other attributes may be classified as immutable. In one embodiment, immutable attributes are not tracked.
The tracked accessed attributes may be provided to the distributed store, as indicated at 854. In one embodiment, the tracked accessed attributes may be compared to an original or benchmark version of the attributes to determine which of the tracked accessed attributes were actually modified. In one embodiment, this comparison may employ a binary differencing method to compare the provided attributes to a set of benchmark attributes to determine the modified attributes. In another embodiment, an object graph differencing method may be employed to compare the provided attributes to a set of benchmark attributes to determine the modified attributes and/or modified portions of attributes. The primary state and the client state may then be synchronized using the modified attributes and/or modified portions of attributes, as indicated at 856.
FIG. 10 illustrates a method for providing attributes to a distributed store during synchronization of a primary state with a client state, according to one embodiment. A client state of session data may be accessed, as indicated at 900, for example by one or more processes executing within an application server. In one embodiment, information may be maintained on which of the attributes of the session data have been accessed. In one embodiment, the information on accessed attributes may include a list of keys or names identifying the accessed attributes.
The method may include determining which attributes were modified as indicated at 902. In one embodiment, a differencing component of the application server may determine which attributes were modified. In one embodiment, a binary differencing method may be used to compare the client state attributes to a benchmark or original of the attributes to determine the modified attributes. In another embodiment, an object graph differencing method may be used to compare the client state attributes to a benchmark of the attributes to determine the modified attributes. In other embodiments, other methods to determine the modified attributes. In some embodiments, the method used to determine which attributes have been modified (binary diff, object graph diff, etc.) may applied to only certain attributes. For example, in one embodiment, the only the accessed attributes are checked for changes since unaccessed attributes presumably were not changed. In yet another embodiment, in addition to eliminating unaccessed attributes from the determination process, attribute that were not accessed by a mutable access are also eliminated from the determination process. In one embodiment, only the mutably accessed attributes are checked to determine which of the mutably accessed attributes were actually modified. In still yet another embodiment, only attributes classified as mutable are checked for changes. Attributes classified as immutable may be eliminated from the determination process. Mutable attributes that have not been accessed or that have been accessed by a non-mutable access (e.g.) may also be eliminated (not checked) when determining which of the accessed mutable attributes were actually modified.
The method may then include synchronizing a corresponding primary state (e.g. in a distributed store) with the client state using the modified attributes, as indicated at 904. In one embodiment, only the attributes determined to have been modified are used for the synchronizing. For example, in one embodiment, unmodified client state attributes need not be sent when updating the corresponding primary state in a distributed store.
FIG. 11 illustrates a distributed store node using a differencing mechanism to synchronize instances of a primary state to a back-up node, according to one embodiment. Distributed store node 110A may include a primary state 112 of session data. In one embodiment, distributed store node 110A is part of or associated with one of one or more application servers in a distributed or clustered system. In one embodiment, the primary state may be distributed across multiple stores (e.g. computer-accessible mediums and/or other systems). Back-up node 506 may be another distributed store node associated with another application server in the system. In another embodiment, back-up node 506 may be part of a backend system or a dedicated back-up system.
One or more additional instances of the primary state may serve as backup copies of the primary state and may themselves be stored on different nodes of the distributed store system, or alternatively on other systems and/or backend systems. In one embodiment, these other instances of the primary state may be distributed across multiple computer-accessible mediums and/or other systems. It may be necessary or desirable to maintain synchronization between the various instances of the primary state.
In one embodiment, distributed store node 110A may retain a benchmark state 500. This benchmark state 500 may be a copy of or otherwise indicate a back-up instance of the primary state on one or more other nodes. In other embodiments, benchmark state 500 may be stored elsewhere and be provided to or accessed by the differencing mechanism 502. Differencing mechanism 502 may generate a primary state delta 504 between primary state 112 and the benchmark state 500. Primary state delta 504 may indicate differences in session data between the primary state 112 and the benchmark state 500.
In one embodiment, differencing mechanism 502 may perform a binary comparison of primary state 112 with benchmark state 500 to generate primary state delta 504. In performing a binary comparison, the bits of one set of data are compared to the bits of the other set of data. In one embodiment, this comparison may be done n bits at a time. For example, the data may be compared byte by byte or alternatively by any n-bit boundary suitable for the data. In one embodiment, primary state delta 504 may include one or more attributes of the session data that the binary comparison determined to be different between the primary state 112 and the benchmark primary state 500.
In another embodiment, differencing mechanism 502 may use object graph differencing to compare an object graph representation of primary state 112 with an object graph representation of benchmark primary state 500 to generate primary state delta 504. An object graph may include a directed graph representation of an object's members and descendent members (i.e. members of members). Finding the differences between two objects may include comparing the structure of one object's directed graph representation with the structure of the other object's directed graph representation. In one embodiment, primary state delta 504 may include one or more attributes of the session data that the object graph comparison determined to be different between the primary state 112 and the benchmark primary state 500. In one embodiment, primary state delta 504 may include one or more portions of attributes of the session data that the object graph comparison determined to be different between the primary state 112 and the benchmark primary state 500. In other embodiments, differencing mechanism 502 may use other methods to generate primary state delta 504. In some embodiments, regardless what comparison mechanism is employed, the comparison may be simplified by eliminating from the comparison attributes and/or portions of attributes of the primary state classified as immutable attributes.
After differencing mechanism 502 generates primary state delta 504, distributed store node 110A may provide primary state delta 504 to back-up node 506, and back-up node 506 may synchronize its instance of the primary state data 508 with the primary state 112 using primary state delta 504. The differencing mechanism 502 may provide a mechanism for obtaining modified attributes so that the load on resources (e.g. the network) may be reduced by sending only the modified and not the unmodified portions of the session data to the backend system 506. In another embodiment, instead of comparing the primary state 112 to a benchmark state 500, differencing mechanism 502 eliminate immutable attributes from the primary state 112 and supply the remaining attributes as primary state deltas 504.
In one embodiment, other instances of the primary state may be synchronized using the primary state delta 504 provided by the differencing mechanism 502. Synchronizing the other instances of the primary state using the primary state may use fewer resources, such as network bandwidth, than sending the entire primary state during the synchronizing process. Alternatively, other instances of the primary state may be replaced or synchronized as described above with the newly synchronized instance from the back-up node 506. Other embodiments may use other methods to synchronize the other instances.
FIG. 12 illustrates a method for updating one or more back-up instances of a primary state using binary differencing to determine a primary state delta according to one embodiment. A binary comparison of the primary state and a benchmark of the primary state may be performed to generate a primary state delta, as indicated at 950. For example, the bits of the primary state may be compared to the bits of the benchmark primary state n bits at a time to determine modified attributes. In one embodiment, the primary state delta may include one or more attributes of the session data that the binary comparison determined to be different between the primary state and the benchmark primary state. After generation of the primary state delta, the primary state delta may be used to synchronize the back-up instances of the primary state on one or more back-up nodes, as indicated at 952. Alternatively, one or more instance of the primary state may be synchronized using the primary state delta, and one or more other instances of the primary state may be replaced with one of the newly synchronized instance.
FIG. 13 illustrates a method for updating instances of a primary state using object graph differencing to determine a primary state delta, according to one embodiment. The method may include performing an object graph comparison of the primary state and a benchmark of the primary state to generate a primary state delta, as indicated at 976. The object graph comparison may find the differences between the primary state and the benchmark primary state by traversing and comparing an object graph representation of the primary state with an object graph representation of the benchmark primary state. An object graph may include a directed graph representation of an object's members and descendent members (i.e. members of members). In one embodiment, the primary state delta may include one or more attributes and/or portions of attributes of the session data that the object graph comparison determines to be different between the primary state and the benchmark of the primary state. After generation of the primary state delta, the primary state delta may be used to synchronize other instances of the primary state, as indicated at 978. For example, the primary state delta may be sent to one or more back-up nodes of a distributed store.
FIG. 14 illustrates a method of accessing and synchronizing state data according to one embodiment. A process executing on an application server, for example, may obtain locked access to a primary state of session data on a distributed store, as indicated at 980. In one embodiment, threads of the process may obtain more atomic locked access on the primary state. The process and/or the threads may access the primary state, and the application server may track mutable accesses (e.g. reads from mutable attributes and writes to any attributes) to the session data as indicated at 982. In one embodiment, the application server may maintain a list of keys or names of attributes that have been mutably accessed, and the application server may provide the list to the object graph differencing method. In another embodiment, accessed mutable attributes may be tracked, and only the accessed mutable attributes may be provided to the differencing mechanism, which may then determine which of the accessed mutable attributes were actually modified. The application server may provide the tracked mutably accessed attributes to an object graph differencing mechanism.
In one embodiment, the application server may provide a benchmark session data to the object graph differencing mechanism. In other embodiments, the object graph differencing mechanism may access the benchmark session data from other sources. An object graph comparison may be performed of an object graph representation of the mutably accessed attributes with an object graph representation of the benchmark session data to determine the modified attributes and/or modified portions of attributes, as indicate at 984.
The modified attributes and/or modified portions of attributes may be synchronized to a distributed store, as indicated at 986. The distributed store may update the primary state using the modified attributes. Using embodiments of the method illustrated in FIG. 14 may help prevent data loss and maintain synchronization between instances of state data of while preferably reducing the overhead of the synchronization process.
While embodiments of the system and method are described herein in respect to enterprise systems and/or application servers, it is noted that embodiments of the system and method may be used in various other application areas that require synchronization of data. For example, embodiments of the system and method may be applicable in peer-to-peer networks or other Internet client/server applications. In general, embodiments of the system and method as described herein may be used in any of a variety of environments that require synchronization of data.
Note that the methods described herein are exemplary and not intended to be limiting. The methods may be implemented in software, hardware, or a combination thereof. The order of methods may be changed, and various elements may be added, reordered, combined, omitted, modified, etc.
Various embodiments may further include receiving, sending or storing instructions and/or data implemented in accordance with the foregoing description upon a computer-accessible medium or article of manufacture. Generally speaking, a computer-accessible medium or article of manufacture may include storage media or memory media such as magnetic or optical media, e.g., disk or CD-ROM, volatile or non-volatile media such as RAM (e.g. SDRAM, DDR SDRAM, RDRAM, SRAM, etc.), ROM, etc. as well as transmission media or signals such as electrical, electromagnetic, or digital signals, conveyed via a communication medium such as network and/or a wireless link.
Various modifications and changes may be made as would be obvious to a person skilled in the art having the benefit of this disclosure. It is intended that the invention embrace all such modifications and changes and, accordingly, the above description to be regarded in an illustrative rather than a restrictive sense.

Claims (12)

1. A system comprising:
a plurality of application servers, wherein each of the plurality of application servers is configured to access session data, wherein the session data represents a state of a client session for a client; and
a distributed store comprising a primary state of the session data configured for access by the plurality of application servers, wherein the distributed store is configured to provide locked access to the primary state to a process executing within one of the plurality of application servers, wherein, while the primary state is locked for the process, other processes cannot access the primary state;
wherein the process is configured to provide locked access to portions of the primary state to one or more threads executing within the process, wherein, while a portion of the primary state is locked for one of the threads, other threads executing within the process cannot access the particular portion of the primary state;
wherein the distributed store is configured to request the process to release the locked access, wherein the process is configured to release the locked access in response to said request.
2. The system as recited in claim 1, wherein, after the process has completed a current access of the primary state, the process is configured to hold locked access until after receiving a request to release the locked access.
3. The system as recited in claim 1, wherein the distributed store is configured to grant the locked access to the process executing in one of the application servers in response to a request for locked access from said process.
4. The system as recited in claim 1, wherein the distributed store is configured to buffer one or more requests for locked access from one or more other processes executing within one or more of the plurality of application servers.
5. The system as recited in claim 4, wherein, if the process releases the locked access to the primary state, the distributed store is configured to provide locked access to one of the other processes in response to the other process's buffered request.
6. The system as recited in claim 1, wherein another process executing within one of the plurality of application servers is configured to request locked access to the primary state from the distributed store, and wherein if no process currently holds locked access to the primary state, the distributed store is configured to provide locked access to the primary state to the other process.
7. A method, comprising:
a process executing within one of a plurality of application servers requesting locked access to a primary state of session data stored by a distributed store;
the distributed store granting a lock to the process requesting locked access, wherein, while the process holds the lock, other processes cannot access the primary state in the distributed store;
the process holding the lock granting a thread-level lock to a portion of the primary state to a thread running within the process, wherein, while the thread holds the thread-level lock, other threads cannot access the portion of the primary state;
the distributed store requesting the process release the locked access; and
the process releasing the locked access in response to said request by the distributed store.
8. The method as recited in claim 7, further comprising the process releasing the lock when the process no longer requires locked access to the primary state.
9. The method as recited in claim 7, further comprising buffering one or more requests for locked access from one or more other processes executing within one or more of the plurality of application servers.
10. The method as recited in claim 9, further comprising, if the process releases the locked access to the primary state, the distributed store granting locked access to one of the other processes in response to the other process's buffered request.
11. A computer-accessible storage medium, comprising software instructions executable to implement:
a process executing within one of a plurality of application servers requesting locked access to a primary state of session data stored by a distributed store;
the process receiving locked access from the distributed store, wherein, while the process holds a lock, other processes cannot access the primary state in the distributed store;
the process granting a thread-level lock to a portion of the primary state to a thread running within the process, wherein, while the thread holds the thread-level lock, other threads cannot access the portion of the primary state;
the process receiving a request by the distributed store to release the locked access; and
the process releasing the locked access in response to said request by the distributed store.
12. The computer-accessible storage medium as recited in claim 11, wherein the software instructions are further executable to implement the process releasing the lock when the process no longer requires locked access to the primary state.
US10/087,234 2002-03-01 2002-03-01 Lock mechanism for a distributed data system Active 2024-06-25 US7240058B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US10/087,234 US7240058B2 (en) 2002-03-01 2002-03-01 Lock mechanism for a distributed data system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
US10/087,234 US7240058B2 (en) 2002-03-01 2002-03-01 Lock mechanism for a distributed data system

Publications (2)

Publication Number Publication Date
US20030167268A1 US20030167268A1 (en) 2003-09-04
US7240058B2 true US7240058B2 (en) 2007-07-03

Family

ID=27803870

Family Applications (1)

Application Number Title Priority Date Filing Date
US10/087,234 Active 2024-06-25 US7240058B2 (en) 2002-03-01 2002-03-01 Lock mechanism for a distributed data system

Country Status (1)

Country Link
US (1) US7240058B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060294417A1 (en) * 2005-06-24 2006-12-28 Sun Microsystems, Inc. In-memory replication of timing logic for use in failover within application server node clusters

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030088659A1 (en) * 2001-11-08 2003-05-08 Susarla Hanumantha Rao System and method for distributed state management
US7788346B2 (en) * 2002-03-01 2010-08-31 Oracle America, Inc. System and method for state data back-up in a distributed data system
US7320035B2 (en) * 2002-03-01 2008-01-15 Sun Microsystems, Inc. Object mutation determination for incremental state saves
US7571354B2 (en) * 2003-05-09 2009-08-04 Sun Microsystems, Inc. System and method for request routing
US20050022202A1 (en) * 2003-07-09 2005-01-27 Sun Microsystems, Inc. Request failover mechanism for a load balancing system
US7614054B2 (en) * 2003-12-31 2009-11-03 Intel Corporation Behavioral model based multi-threaded architecture
US20050251537A1 (en) * 2004-05-05 2005-11-10 Hewlett-Packard Development Company, L.P. File locking
US7467413B2 (en) * 2004-12-20 2008-12-16 Sap Ag Method and apparatus for accessing session data
US20080140633A1 (en) * 2006-10-05 2008-06-12 Holt John M Synchronization with partial memory replication
EP2352090B1 (en) * 2008-10-06 2019-09-25 International Business Machines Corporation System accessing shared data by a plurality of application servers
US9578130B1 (en) * 2012-06-20 2017-02-21 Amazon Technologies, Inc. Asynchronous and idempotent distributed lock interfaces
US9589039B2 (en) * 2012-12-13 2017-03-07 Sybase, Inc. Synchronization of metadata in a multi-threaded system
US9400677B2 (en) * 2013-01-02 2016-07-26 Apple Inc. Adaptive handling of priority inversions using transactions

Citations (42)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5721943A (en) 1993-10-14 1998-02-24 International Business Machines Corporation Negotiable locks for concurrent access of control data by multiple programs
US5734909A (en) * 1995-09-01 1998-03-31 International Business Machines Corporation Method for controlling the locking and unlocking of system resources in a shared resource distributed computing environment
US5813017A (en) 1994-10-24 1998-09-22 International Business Machines Corporation System and method for reducing storage requirement in backup subsystems utilizing segmented compression and differencing
US5870759A (en) 1996-10-09 1999-02-09 Oracle Corporation System for synchronizing data between computers using a before-image of data
US5884325A (en) * 1996-10-09 1999-03-16 Oracle Corporation System for synchronizing shared data between computers
US5907848A (en) 1997-03-14 1999-05-25 Lakeview Technology, Inc. Method and system for defining transactions from a database log
US6131166A (en) 1998-03-13 2000-10-10 Sun Microsystems, Inc. System and method for cross-platform application level power management
US6195091B1 (en) 1995-03-09 2001-02-27 Netscape Communications Corporation Apparatus for collaborative computing
US6360249B1 (en) 1998-03-06 2002-03-19 I2 Technologies Us, Inc. Enterprise interaction hub for managing an enterprise web system
US20020143958A1 (en) * 2001-03-30 2002-10-03 Montero Gabriel G. Method and apparatus for asynchronous time-based updates of http sessions
US20020165961A1 (en) 2001-04-19 2002-11-07 Everdell Peter B. Network device including dedicated resources control plane
US6484185B1 (en) * 1999-04-05 2002-11-19 Microsoft Corporation Atomic operations on data structures
US6499031B1 (en) * 1999-07-26 2002-12-24 Microsoft Corporation Systems and methods for using locks with computer resources
US20030014650A1 (en) 2001-07-06 2003-01-16 Michael Freed Load balancing secure sockets layer accelerator
US20030018785A1 (en) * 2001-07-17 2003-01-23 International Business Machines Corporation Distributed locking protocol with asynchronous token prefetch and relinquish
US20030041179A1 (en) 2001-08-23 2003-02-27 Microsoft Corporation Method and system for providing state change notifications in device drivers
US6529941B2 (en) 2000-03-23 2003-03-04 Fraunhofer Center For Research In Computer Graphics, Inc. Extensible information distribution mechanism for session management
US20030051145A1 (en) 2001-09-07 2003-03-13 Jackson Matthew G. System for issuing and using secure cards
US6546135B1 (en) 1999-08-30 2003-04-08 Mitsubishi Electric Research Laboratories, Inc Method for representing and comparing multimedia content
US20030069874A1 (en) 1999-05-05 2003-04-10 Eyal Hertzog Method and system to automate the updating of personal information within a personal information management application and to synchronize such updated personal information management applications
US20030074395A1 (en) 2001-10-17 2003-04-17 Kave Eshghi Allowing requests of a session to be serviced by different servers in a multi-server data service system
US20030088659A1 (en) 2001-11-08 2003-05-08 Susarla Hanumantha Rao System and method for distributed state management
US20030101300A1 (en) * 2001-11-13 2003-05-29 Microsoft Corporation. Method and system for locking multiple resources in a distributed environment
US20030131041A1 (en) * 2002-01-10 2003-07-10 Darpan Dinker System and method for coordinating access to data for a distributed application
US6594686B1 (en) 2000-03-02 2003-07-15 Network Associates Technology, Inc. Obtaining user responses in a virtual execution environment
US20030163494A1 (en) * 2002-02-28 2003-08-28 International Business Machines Corporation Weak record locks in database query read processing
US20030167297A1 (en) 2002-03-01 2003-09-04 Sun Microsystems, Inc. Deterministic immutable access elimination for efficient distributed state saves
US20030167332A1 (en) 2002-03-01 2003-09-04 Sun Microsystems, Inc. Object mutation determination for incremental state saves
US20030167333A1 (en) 2002-03-01 2003-09-04 Sun Microsystems, Inc. System and method for state saves in a distributed data system
US20030167331A1 (en) 2002-03-01 2003-09-04 Sun Microsystems, Inc. System and method for state data back-up in a distributed data system
US20030167285A1 (en) 2002-03-01 2003-09-04 Sun Microsystems, Inc. Incremental saves for efficient distributed state stores
US6643652B2 (en) 2000-01-14 2003-11-04 Saba Software, Inc. Method and apparatus for managing data exchange among systems in a network
US20030212987A1 (en) 2001-02-28 2003-11-13 Demuth Steven J. Client container for building EJB-hosted java applications
US6687745B1 (en) 1999-09-14 2004-02-03 Droplet, Inc System and method for delivering a graphical user interface of remote applications over a thin bandwidth connection
US6704782B1 (en) 1999-12-09 2004-03-09 International Business Machines Corporation System and methods for real time progress monitoring in a computer network
US6738975B1 (en) 1998-11-18 2004-05-18 Software Ag, Inc. Extensible distributed enterprise application integration system
US6742141B1 (en) 1999-05-10 2004-05-25 Handsfree Networks, Inc. System for automated problem detection, diagnosis, and resolution in a software driven system
US6760765B1 (en) 1999-11-09 2004-07-06 Matsushita Electric Industrial Co., Ltd. Cluster server apparatus
US6813635B1 (en) 2000-10-13 2004-11-02 Hewlett-Packard Development Company, L.P. System and method for distributing load among redundant independent stateful world wide web server sites
US6859834B1 (en) 1999-08-13 2005-02-22 Sun Microsystems, Inc. System and method for enabling application server request failover
US6877111B2 (en) 2001-03-26 2005-04-05 Sun Microsystems, Inc. Method and apparatus for managing replicated and migration capable session state for a Java platform
US7093230B2 (en) * 2002-07-24 2006-08-15 Sun Microsystems, Inc. Lock management thread pools for distributed data systems

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US212987A (en) * 1879-03-04 Improvement in fasteners for meeting-rails of sashes
US165961A (en) * 1875-07-27 Improvement in heel-stiffeners
US88659A (en) * 1869-04-06 Improvement in weeding-hoe
US74395A (en) * 1868-02-11 Self and c
US41179A (en) * 1864-01-05 Improvement in lamp-burners
US69874A (en) * 1867-10-15 Improved plough

Patent Citations (43)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5721943A (en) 1993-10-14 1998-02-24 International Business Machines Corporation Negotiable locks for concurrent access of control data by multiple programs
US5813017A (en) 1994-10-24 1998-09-22 International Business Machines Corporation System and method for reducing storage requirement in backup subsystems utilizing segmented compression and differencing
US6195091B1 (en) 1995-03-09 2001-02-27 Netscape Communications Corporation Apparatus for collaborative computing
US5734909A (en) * 1995-09-01 1998-03-31 International Business Machines Corporation Method for controlling the locking and unlocking of system resources in a shared resource distributed computing environment
US5870759A (en) 1996-10-09 1999-02-09 Oracle Corporation System for synchronizing data between computers using a before-image of data
US5884325A (en) * 1996-10-09 1999-03-16 Oracle Corporation System for synchronizing shared data between computers
US5907848A (en) 1997-03-14 1999-05-25 Lakeview Technology, Inc. Method and system for defining transactions from a database log
US6360249B1 (en) 1998-03-06 2002-03-19 I2 Technologies Us, Inc. Enterprise interaction hub for managing an enterprise web system
US6131166A (en) 1998-03-13 2000-10-10 Sun Microsystems, Inc. System and method for cross-platform application level power management
US6738975B1 (en) 1998-11-18 2004-05-18 Software Ag, Inc. Extensible distributed enterprise application integration system
US6484185B1 (en) * 1999-04-05 2002-11-19 Microsoft Corporation Atomic operations on data structures
US20030069874A1 (en) 1999-05-05 2003-04-10 Eyal Hertzog Method and system to automate the updating of personal information within a personal information management application and to synchronize such updated personal information management applications
US6742141B1 (en) 1999-05-10 2004-05-25 Handsfree Networks, Inc. System for automated problem detection, diagnosis, and resolution in a software driven system
US6499031B1 (en) * 1999-07-26 2002-12-24 Microsoft Corporation Systems and methods for using locks with computer resources
US6859834B1 (en) 1999-08-13 2005-02-22 Sun Microsystems, Inc. System and method for enabling application server request failover
US6546135B1 (en) 1999-08-30 2003-04-08 Mitsubishi Electric Research Laboratories, Inc Method for representing and comparing multimedia content
US6687745B1 (en) 1999-09-14 2004-02-03 Droplet, Inc System and method for delivering a graphical user interface of remote applications over a thin bandwidth connection
US6760765B1 (en) 1999-11-09 2004-07-06 Matsushita Electric Industrial Co., Ltd. Cluster server apparatus
US6704782B1 (en) 1999-12-09 2004-03-09 International Business Machines Corporation System and methods for real time progress monitoring in a computer network
US6643652B2 (en) 2000-01-14 2003-11-04 Saba Software, Inc. Method and apparatus for managing data exchange among systems in a network
US6594686B1 (en) 2000-03-02 2003-07-15 Network Associates Technology, Inc. Obtaining user responses in a virtual execution environment
US6529941B2 (en) 2000-03-23 2003-03-04 Fraunhofer Center For Research In Computer Graphics, Inc. Extensible information distribution mechanism for session management
US6813635B1 (en) 2000-10-13 2004-11-02 Hewlett-Packard Development Company, L.P. System and method for distributing load among redundant independent stateful world wide web server sites
US20030212987A1 (en) 2001-02-28 2003-11-13 Demuth Steven J. Client container for building EJB-hosted java applications
US6877111B2 (en) 2001-03-26 2005-04-05 Sun Microsystems, Inc. Method and apparatus for managing replicated and migration capable session state for a Java platform
US20020143958A1 (en) * 2001-03-30 2002-10-03 Montero Gabriel G. Method and apparatus for asynchronous time-based updates of http sessions
US20020165961A1 (en) 2001-04-19 2002-11-07 Everdell Peter B. Network device including dedicated resources control plane
US20030014650A1 (en) 2001-07-06 2003-01-16 Michael Freed Load balancing secure sockets layer accelerator
US20030018785A1 (en) * 2001-07-17 2003-01-23 International Business Machines Corporation Distributed locking protocol with asynchronous token prefetch and relinquish
US20030041179A1 (en) 2001-08-23 2003-02-27 Microsoft Corporation Method and system for providing state change notifications in device drivers
US20030051145A1 (en) 2001-09-07 2003-03-13 Jackson Matthew G. System for issuing and using secure cards
US20030074395A1 (en) 2001-10-17 2003-04-17 Kave Eshghi Allowing requests of a session to be serviced by different servers in a multi-server data service system
US20030088659A1 (en) 2001-11-08 2003-05-08 Susarla Hanumantha Rao System and method for distributed state management
US20030101300A1 (en) * 2001-11-13 2003-05-29 Microsoft Corporation. Method and system for locking multiple resources in a distributed environment
US20030131041A1 (en) * 2002-01-10 2003-07-10 Darpan Dinker System and method for coordinating access to data for a distributed application
US7130905B2 (en) * 2002-01-10 2006-10-31 Sun Microsystems, Inc. System and method for coordinating access to data for a distributed application
US20030163494A1 (en) * 2002-02-28 2003-08-28 International Business Machines Corporation Weak record locks in database query read processing
US20030167285A1 (en) 2002-03-01 2003-09-04 Sun Microsystems, Inc. Incremental saves for efficient distributed state stores
US20030167331A1 (en) 2002-03-01 2003-09-04 Sun Microsystems, Inc. System and method for state data back-up in a distributed data system
US20030167333A1 (en) 2002-03-01 2003-09-04 Sun Microsystems, Inc. System and method for state saves in a distributed data system
US20030167332A1 (en) 2002-03-01 2003-09-04 Sun Microsystems, Inc. Object mutation determination for incremental state saves
US20030167297A1 (en) 2002-03-01 2003-09-04 Sun Microsystems, Inc. Deterministic immutable access elimination for efficient distributed state saves
US7093230B2 (en) * 2002-07-24 2006-08-15 Sun Microsystems, Inc. Lock management thread pools for distributed data systems

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
"iPlanet Application Server-Overview Guide-Version 6.0," Sun Microsystems, Inc., May 2000, (78 Pages).
Burns et al., "A Linear Time, Constant Space Differencing Algorithm," 1997 IEEE, Performance, Computing and Communications Conference, 1997, (pp. 429-436).
Roh, et al., "A Switchable Session Managemetn for the Distributed Multimedia-on-Demand System, Protocols for Multimedia Systems-Multimedia Networking," 1997, Proceedings IEEE Conference on Nov. 24-27, 1997, pp. 102-111.

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060294417A1 (en) * 2005-06-24 2006-12-28 Sun Microsystems, Inc. In-memory replication of timing logic for use in failover within application server node clusters
US7480823B2 (en) * 2005-06-24 2009-01-20 Sun Microsystems, Inc. In-memory replication of timing logic for use in failover within application server node clusters

Also Published As

Publication number Publication date
US20030167268A1 (en) 2003-09-04

Similar Documents

Publication Publication Date Title
US7370329B2 (en) System and method for state saves in a distributed data system
US7788346B2 (en) System and method for state data back-up in a distributed data system
US7093230B2 (en) Lock management thread pools for distributed data systems
US10805227B2 (en) System and method for controlling access to web services resources
US7320035B2 (en) Object mutation determination for incremental state saves
US10067791B2 (en) Methods and apparatus for resource management in cluster computing
US8996482B1 (en) Distributed system and method for replicated storage of structured data records
US7565406B2 (en) Last thread lock management for multi-threaded process and distributed data systems
US7254578B2 (en) Concurrency classes for shared file systems
US8086581B2 (en) Method for managing lock resources in a distributed storage system
US8635193B2 (en) Cluster-wide read-copy update system and method
US7181489B2 (en) Method, apparatus, and program for distributing a document object model in a web server cluster
US20030065672A1 (en) System and method for implementing journaling in a multi-node environment
US7240058B2 (en) Lock mechanism for a distributed data system
US7747647B2 (en) Distributing permission information via a metadirectory
US6952707B1 (en) Efficient sequence number generation in a multi-system data-sharing environment
KR20170002441A (en) File service using a shared file access-rest interface
US20060184528A1 (en) Distributed database with device-served leases
EP1374048A2 (en) Workload management of stateful program entities (e.g. enterprise java session beans)
US9553951B1 (en) Semaphores in distributed computing environments
EP2754059A2 (en) Clustered client failover
US7085852B2 (en) Deterministic immutable access elimination for efficient distributed state saves
US6687716B1 (en) File consistency protocols and methods for carrying out the protocols
US6633870B1 (en) Protocols for locking sharable files and methods for carrying out the protocols
US20040019660A1 (en) Lock holding multi-threaded processes for distibuted data systems

Legal Events

Date Code Title Description
AS Assignment

Owner name: SUN MICROSYSTEMS, INC., CALIFORNIA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:KUMAR, AJAY;SUSARLA, HANUMANTHU RAO;KHEMANI, PRAKASH;REEL/FRAME:012849/0251;SIGNING DATES FROM 20020409 TO 20020412

STCF Information on status: patent grant

Free format text: PATENTED CASE

FPAY Fee payment

Year of fee payment: 4

FPAY Fee payment

Year of fee payment: 8

AS Assignment

Owner name: ORACLE AMERICA, INC., CALIFORNIA

Free format text: MERGER AND CHANGE OF NAME;ASSIGNORS:ORACLE USA, INC.;SUN MICROSYSTEMS, INC.;ORACLE AMERICA, INC.;REEL/FRAME:037302/0772

Effective date: 20100212

MAFP Maintenance fee payment

Free format text: PAYMENT OF MAINTENANCE FEE, 12TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1553); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

Year of fee payment: 12