EP2385472B1

Fine grain synchronization for database replay

Abstract

This record has no abstract on file.

EP2385472B1, drawing sheet 1
Sheet 1 of 6

Term

4.6 yearsleft in the term

Expires 5 May 2031.

  1. Priority
  2. Filed
  3. Granted
  4. Today
  5. Expires

15 claims: 4 independent, 11 dependent

  1. 1
    A method of capturing and processing database commands executed against a database by one or more database servers of a production system, the method comprising:storing workload information including captured object identifiers, captured indications of whether the objects were read and/or written, and captured database commands, wherein the workload information may be processed to determine that a database object accessed when the production system executed a database command may have been previously modified when the production system previously executed one or more other database commands;after the workload information has been stored and before database commands from the workload information are replayed, determining, based at least in part on the stored workload information, that the second database command is considered to depend on the first database command by: determining that the second database command accessed a database object that was previously at least potentially modified by the first database command;wherein the database object is considered to have been previously at least potentially modified by the first database command if execution of the first database command caused the one or more database servers to obtain an exclusive lock on said database object;based at least in part on determining that the second database command is considered to depend on the first database command, storing, in a dependency graph, an entry for the second database command that specifies the first database command;wherein the dependency graph stores a plurality of entries, wherein each entry is for a separate database command, and wherein each entry specifies one or more other database commands from which the separate database command is considered to depend;replaying the captured and processed database commands on one or more database servers of a test system, wherein the captured and processed database commands are replayed in any order that satisfies the dependency graph;wherein said test system has a different hardware and/or software and/or configuration than said production system;and wherein said replaying is for determining, in preparation of upgrading the one or more database servers of the production system, whether the difference between the test system and the production system is a permissible difference.
  2. 2
    The method of Claim 1, further comprising:based on the dependency graph, preventing the second database command from being executed until after execution of the first database command during a replay of the database commands.
  3. 3
    The method of Claim 1, further comprising:based on the dependency graph, triggering the second database command to be executed after execution of the first database command during a replay of the database commands.
  4. 4
    The method of Claim 1, further comprising, during a replay of the database commands:receiving the second database command to be executed;determining that the first database command has not been executed during the replay;in response to determining that the first database command has not been executed during the replay, waiting to cause execution of the second database command;after the waiting, determining that the first database command has been executed during the replay;in response to determining that the first database command has been executed during the replay, causing execution of the second database command.
  5. 5
    The method of Claim 4, wherein determining that the first database command has not been executed comprises:accessing a counter that records a count of a most recently executed command by a thread associated with the first database command.
  6. 6
    The method of Claim 1, wherein dependencies resulting from database commands collected from the same thread are removed from the dependency graph, and wherein, when replaying the captured and processed database commands, database commands captured from the same thread are replayed so that the order of execution is preserved.
  7. 7
    The method of Claim 1, the method further comprising:determining that a third database command depends on both the first database command and the second database command;and based at least in part on (a) determining that the third database command depends on both the first database command and the second database command and (b) determining that the second database command depends on the first database command, storing, in the dependency graph, an entry for the third database command that specifies the second database command but not the first database command.
  8. 8
    The method of Claim 1, the method further comprising:determining that the second database command also depends on a third database command;and wherein the stored entry also specifies the third database command.
  9. 9
    The method of Claim 1, further comprising:optimizing the dependency graph by removing redundant information from the dependency graph.
  10. 10
    A method of replaying database commands on a database system, wherein the database commands are captured and processed according to the method as recited in any one of Claims 1-9, the method comprising:accessing the dependency graph, the dependency graph comprising an entry for a second previously executed database command that specifies a first previously executed database command;receiving the second previously executed database command to be executed during a replay of the database commands;using the dependency graph to determine that the second previously executed database command is considered to depend on the first previously executed database command;determining that the first previously executed database command has not been executed during the replay of the database commands;in response to determining that the first previously executed database command has not been executed during the replay of the database commands and that the second previously executed database command is considered to depend on the first previously executed database command, waiting to cause execution of the second previously executed database command until after execution of the first previously executed database command;and wherein the captured and processed database commands are replayed in any order that satisfies the dependency graph.
  11. 11
    The method of Claim 10, wherein the dependency graph does not include a logical time that the first or the second database commands were previously executed on one or more database servers.
  12. 12
    The method of Claim 10, wherein the dependency graph is generated based at least in part on a determination that dependencies resulting from database commands collected from the same thread are removed from the dependency graph, and wherein, when replaying the captured and processed database commands, database commands captured from the same thread are replayed so that the order of execution is preserved.
  13. 13
    The method of Claim 10, wherein the determining that the first previously executed database command has not been executed during the replay of the database commands comprises:accessing a counter that records a count of a most recently executed command by a thread associated with the first database command.
  14. 14
    One or more storage media storing instructions which, when executed by one or more computing devices, cause performance of a method as recited in any one of Claims 1-13.
  15. 15
    An apparatus comprising:one or more processors;one or more storage devices storing instructions which, when executed by the one or more processors, cause the one or more processors to perform a method as recited in any one of Claims 1-13.