摘要:
A method and system are provided for caching data in a manner that substantially maintains a desired level of system performance. A cache server receives data requests on behalf of a data server. When new data on the data server is generated or stored that replaces or changes data cached on the cache server, the corresponding data on the cache server is invalidated. A subsequent request for the new data may be forwarded to the data server or may be served with the invalid data on the cache server. Determining how to serve the request may depend on a possible impact on system performance and/or one or more characteristics or parameters associated with the requested data. The impact on system performance may be determined by examining actual and/or desired operating conditions (e.g., rate or number of requests, load on the data server, response time to requests, number of open connections, throughput). The data parameters that may be considered may include the popularity of the data; frequency of access to the data; number of accesses; age, size, or type of the data; whether or when a version of the data on the cache server is invalid; how severely invalid the cache server version is; the cost of retrieving the data from the data server; etc. One request received for the new data may be forwarded to the data server in order to receive the new data, cache it and return in to the requester. In order to promote performance, however, any number of requests for new data that is to replace cached data (even a first request received after the cached data is invalidated) may be served with cache data that is responsive but invalid.
摘要:
The present invention describes a method and apparatus that forces all parts of an update transaction to commit automatically using a two-phase commit. The present invention uses the two-phase commit messages to negotiate a system commit number (SCN) that is then recorded on each of the nodes as the logical point in time that the distributed transaction committed. The two-phase commit scheme of the present invention consists of a "prepare" phase and a "commit" phase. The transaction in the distributed database environment involves multiple participants (databases). In the prepare phase, one of the N database participants is selected as the "commit point." The commit point includes the log into which the information is written that states the transaction has committed. The remaining N-1 participants enter a "prepare phase." In the prepare phase, the prepare participants lock their databases and enter a state in which they are ready to roll back or commit to the transaction. The mid-point of the two-phase commit is the point at which the commit point database (nth participant) writes the commit transaction to its log. In the second phase, the remaining participants are informed to commit the transaction and release locks that have been set.
摘要:
Techniques are provided for managing caches in a system with multiple caches that may contain different copies of the same data item. Specifically, techniques are provided for coordinating the write-to-disk operations performed on such data items to ensure that older versions of the data item are not written over newer versions, and to reduce the amount of processing required to recover after a failure. Various approaches are provided in which a master is used to coordinate with the multiple caches to cause a data item to be written to persistent storage. Techniques are also provided for managing checkpoints associated with the caches, where the checkpoints are used to determine the position at which to begin processing recovery logs in the event of a failure.
摘要:
A mechanism is described for managing the caches on nodes in a cluster. The caches are globally managed so that a data item may be retained in any cache on the nodes. This may be accomplished by, for example, a replacement policy for replacing data items stored in the buffers of the caches, where a buffer is selected for replacement in a manner that accounts for factors that include the state of the caches of other nodes. Some cached data items are designated as globally shared, and assigned (either statically or dynamically) a primary cache. For example, if a buffer holds a copy of a data item whose primary cache is another node, then the data item in the buffer is favored for replacement over a local data item or a global data item for which this is the primary cache. According to another aspect of the invention, the cache retention value of buffers on different nodes are compared, and the buffer with the lowest cache retention value is selected for replacement. According to yet another aspect of the present invention, the replacement policy accounts for the configuration of other caches in the cluster.
摘要:
A method and apparatus for supplying data from a database to a group of transactions is provided. A value is maintained for the group of transactions. The value indicates a target snapshot of the database. When a transaction within the group of transactions accesses a data item, it is determined whether the transaction can use the target snapshot. If the transaction can use the target snapshot, then the transaction is supplied a version of the data item that belongs to the target snapshot. If the transaction cannot use the target snapshot, then the transaction is supplied a version of the data item other than the version of the data item that belongs to the target snapshot. Trying to supply data from the same snapshot to all of the transactions in the group increases the likelihood that the transactions will be able to use the same version of any given data item. Consequently, fewer reconstruction operations will have to be performed, and dynamic memory is less likely to become filled with different versions of the same data items.
摘要:
A method and apparatus for determining whether a particular version of a data item may be used by a transaction are provided. To determine whether the particular version may be used by the transaction, a MUST-SEE set associated with the transaction is compared to an EXCLUDED set associated with the particular version, and a CANNOT-SEE set associated with the transaction is compared to an INCLUDED set associated with the particular version. The MUST-SEE set includes all transactions that have made updates that must be seen by the transaction. The EXCLUDED set includes all transactions that have made updates to the data item that have been removed from the particular version of the data item and all transactions that will make changes to the data item in the future. The CANNOT-SEE set includes all transactions that have made updates that cannot be seen by the transaction. The INCLUDED set includes all transactions that have made updates that are reflected in the particular version of the data item. The particular version can be supplied to the transaction if no member of the MUST-SEE set is also a member of the EXCLUDED set, and no member of the CANNOT-SEE set is also a member of the INCLUDED set.
摘要:
Techniques are provided for managing caches in a system with multiple caches that may contain different copies of the same data item. Specifically, techniques are provided for coordinating the write-to-disk operations performed on such data items to ensure that older versions of the data item are not written over newer versions, and to reduce the amount of processing required to recover after a failure. Various approaches are provided in which a master is used to coordinate with the multiple caches to cause a data item to be written to persistent storage. Techniques are also provided for managing checkpoints associated with the caches, where the checkpoints are used to determine the position at which to begin processing recovery logs in the event of a failure.
摘要:
A method and mechanism is disclosed for implementing transaction logging in a database system. In-memory undo records are maintained to log undo information for the database system. Redo records are batch processed, with multiple redo records for a transaction stored on disk at commit time.
摘要:
Techniques are provided for managing caches in a system with multiple caches that may contain different copies of the same data item. Specifically, techniques are provided for coordinating the write-to-disk operations performed on such data items to ensure that older versions of the data item are not written over newer versions, and to reduce the amount of processing required to recover after a failure. Various approaches are provided in which a master is used to coordinate with the multiple caches to cause a data item to be written to persistent storage. Techniques are also provided for managing checkpoints associated with the caches, where the checkpoints are used to determine the position at which to begin processing recovery logs in the event of a failure.
摘要:
Techniques are provided for managing caches in a system with multiple caches that may contain different copies of the same data item. Specifically, techniques are provided for coordinating the write-to-disk operations performed on such data items to ensure that older versions of the data item are not written over newer versions, and to reduce the amount of processing required to recover after a failure. Various approaches are provided in which a master is used to coordinate with the multiple caches to cause a data item to be written to persistent storage. Techniques are also provided for managing checkpoints associated with the caches, where the checkpoints are used to determine the position at which to begin processing recovery logs in the event of a failure.