IP Library Granted Patent US 9,208,191
Granted Patent B2
US 9,208,191 · App. 13/554,967 · Granted Dec 8, 2015

Lock-free, scalable read access to shared data structures

Inventor: Ivan Schreter (Malsch, DE)
Assignee: SAP SE
G06F17/30351G06F12/0261G06F17/30589
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,208,191
App. No.
13/554,967
Granted
Dec 8, 2015
Kind
B2
Abstract

At least one read operation of at least one object of an object graph is initiated. For each corresponding read operation, a reference count of the root object is incremented (with the reference count 1 for the root object initially reflecting a single anchor pointer pointing to the root object). Subsequently, one or more of the objects are changed. Incompatible changes result in the root object, at least one changed object, and any intervening objects within the hierarchy of objects being cloned. The anchor pointer is then linked to the cloned root object. The root object is later dropped when the reference count for the root object is zero. In addition, the object graph is traversed starting at the root object and ending at the at least one changed object removing any edges for such objects. Each object having a reference count of zero is then dropped.

Claims (73)

1. A method comprising:

initiating at least one read operation of at least one object of an object graph, the object graph characterizing a hierarchy of objects stored within an in-memory database that includes a root object, at least a portion of the nodes having corresponding reference counts specifying a number of edges pointing to the associated object, wherein compatible changes can be made to objects in the graph and incompatible changes can be made to objects in the graph;

incrementing, for each corresponding read operation, a reference count of the root object, the reference count for the root object initially reflecting an anchor pointer pointing to the root object;

changing one or more objects;

cloning the root object, at least one changed object, and any intervening objects within the hierarchy of objects if incompatible changes have been made to the at least one changed object to accommodate for such incompatible changes, the cloning creating new edges between affected objects and new edges between newly cloned objects and originally linked objects from old versions of the at least one changed object;

linking the anchor pointer to the cloned root object;

dropping the root object when the reference count for the root object is zero;

traversing the object graph starting at the root object and ending at the at least one changed object removing any edges for such objects; and

dropping each object when its corresponding reference count becomes zero;

wherein:

the database stores data in rows with monotonically-increasing row identifiers;

the database uses multi-version concurrency control for transaction isolation and consistent reading such that, when a new version of a record is created, the new version of the record is given a new row identifier and old versions of the record are maintained for parallel readers and cleaned during a garbage collection process after committing.

2. A method as in claim 1 , wherein the reference counts are striped across two or more CPUs.

3. A non-transitory computer program product storing instructions that, when executed by at least one programmable processor, cause the at least one programmable processor to perform operations comprising:

initiating a read operation of at least one page of a table stored in an in-memory database, the read operation using an anchor object pointing to a first table header object to access the at least one page, the first table header object including a link to a first linked object, the first linked object comprising a handle to a plurality of pages including the at least one page;

cloning the linked object and the table header object concurrently with the read operation, the cloned linked object comprising handles to the plurality of pages including the at least one page;

setting the anchor object to point to the cloned table header object;

linking at least one additional page to the cloned linked object; and

dropping the first table header object and the first linked object after the read operation is completed

wherein:

the database stores data in rows with monotonically-increasing row identifiers;

the database uses multi-version concurrency control for transaction isolation and consistent reading such that, when a new version of a record is created, the new version of the record is given a new row identifier and old versions of the record are maintained for parallel readers and cleaned during a garbage collection process after committing.

4. A computer program product as in claim 3 , wherein the first linked object is a versioned object comprising a reference count, the reference count forcing the in-memory database to maintain the first table header object and the first linked object during the read operations.

5. A computer program product as in claim 4 , wherein the reference counts are striped across two or more CPUs.

6. A computer program product as in claim 3 , wherein the cloned table header object is initially linked to the first linked object.

7. A computer program product as in claim 3 , wherein the first table header object has associated metadata characterizing the corresponding pages.

8. A computer program product as in claim 3 , wherein the cloned table header object is also associated with the metadata associated with the first table header object.

9. A non-transitory computer program product storing instructions that, when executed by at least one programmable processor, cause the at least one programmable processor to perform operations comprising:

initiating at least one read operation of at least one object of an object graph, the object graph characterizing a hierarchy of objects stored in an in-memory database that includes a root object, at least a portion of the nodes having corresponding reference counts specifying a number of edges pointing to the associated object, wherein compatible changes can be made to objects in the graph and incompatible changes can be made to objects in the graph;

incrementing, for each corresponding read operation, a reference count of the corresponding object, the reference count of the root object initially reflecting an anchor pointer pointing to the root object;

changing one or more objects;

cloning the root object, at least one changed object, and any intervening objects within the hierarchy of objects if incompatible changes have been made to the at least one changed object to accommodate for such incompatible changes, the cloning creating new edges between affected objects and new edges between newly cloned objects and originally linked objects from old versions of the at least one changed object;

linking the anchor pointer to the cloned root object;

dropping the root object when the reference count for the root object is zero;

traversing the object graph starting at the root object and ending at the at least one changed object removing any edges for such objects; and

dropping each object when its corresponding reference count becomes zero;

wherein:

the database stores data in rows with monotonically-increasing row identifiers;

the database uses multi-version concurrency control for transaction isolation and consistent reading such that, when a new version of a record is created, the new version of the record is given a new row identifier and old versions of the record are maintained for parallel readers and cleaned during a garbage collection process after committing.

10. A computer program product as in claim 9 , wherein the reference counts are striped across two or more CPUs.

11. A computer program product as in claim 9 , wherein the read operation comprises an incompatible change.

12. A system comprising:

at least one programmable processor; and

memory storing instructions, which when executed by the at least one programmable processor, result in operations comprising:

initiating a read operation of at least one page of a table stored in an in-memory database, the read operation using an anchor object pointing to a first table header object to access the at least one page, the first table header object including a link to a first linked object, the first linked object comprising a handle to a plurality of pages including the at least one page;

cloning the linked object and the table header object concurrently with the read operation, the cloned linked object comprising handles to the plurality of pages including the at least one page;

setting the anchor object to point to the cloned table header object;

linking at least one additional page to the cloned linked object; and

dropping the first table header object and the first linked object after the read operation is completed

wherein:

the database stores data in rows with monotonically-increasing row identifiers;

the database uses multi-version concurrency control for transaction isolation and consistent reading such that, when a new version of a record is created, the new version of the record is given a new row identifier and old versions of the record are maintained for parallel readers and cleaned during a garbage collection process after committing.

13. A system as in claim 12 , wherein the first linked object is a versioned object comprising a reference count, the reference count forcing the in-memory database to maintain the first table header object and the first linked object during the read operations.

14. A system as in claim 13 , wherein the reference counts are striped across two or more CPUs.

15. A system as in claim 12 , wherein the cloned table header object is initially linked to the first linked object.

16. A system as in claim 12 , wherein the first table header object has associated metadata characterizing the corresponding pages.

17. A system as in claim 12 , wherein the cloned table header object is also associated with the metadata associated with the first table header object.

18. A system comprising:

at least one programmable processor; and

memory storing instructions, which when executed by the at least one programmable processor, result in operations comprising:

initiating at least one read operation of at least one object of an object graph, the object graph characterizing a hierarchy of objects stored in an in-memory database that includes a root object, at least a portion of the nodes having corresponding reference counts specifying a number of edges pointing to the associated object, wherein compatible changes can be made to objects in the graph and incompatible changes can be made to objects in the graph;

incrementing, for each corresponding read operation, a reference count of the corresponding object, the reference count of the root object initially reflecting an anchor pointer pointing to the root object;

changing one or more objects;

cloning the root object, at least one changed object, and any intervening objects within the hierarchy of objects if incompatible changes have been made to the at least one changed object to accommodate for such incompatible changes, the cloning creating new edges between affected objects and new edges between newly cloned objects and originally linked objects from old versions of the at least one changed object;

linking the anchor pointer to the cloned root object;

dropping the root object when the reference count for the root object is zero;

traversing the object graph starting at the root object and ending at the at least one changed object removing any edges for such objects; and

dropping each object when its corresponding reference count becomes zero;

wherein:

the database stores data in rows with monotonically-increasing row identifiers;

the database uses multi-version concurrency control for transaction isolation and consistent reading such that, when a new version of a record is created, the new version of the record is given a new row identifier and old versions of the record are maintained for parallel readers and cleaned during a garbage collection process after committing.

19. A system as in claim 18 , wherein the reference counts are striped across two or more CPUs.

20. A system as in claim 18 , wherein the read operation comprises an incompatible change.

Assignments (2)
CHANGE OF NAME Recorded Aug 26, 2014
From: SAP AG
To: SAP SE
Reel/Frame 033625/0223 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 24, 2012
From: SCHRETER, IVAN
To: SAP AG
Reel/Frame 028623/0129 →
Continuity (1)
Related Publication 20140025651A1 · Jan 23, 2014