Closed Bug 612766 Opened 14 years ago Closed 6 years ago

Clone readonly database connections

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: philikon, Unassigned)

References

Details

After bug 552023 lands in m-c we can clone read only database connections to avoid lock contentions.
Which connections would we want as readonly?
(In reply to Mike Connor [:mconnor] from comment #1)
> Which connections would we want as readonly?

E.g.,

http://hg.mozilla.org/mozilla-central/file/1c7e1db3645b/toolkit/components/places/History.cpp#l1391

If you mean "in Sync": consider that a huge amount of the work Sync does -- building metadata, uploading records, and reconciling incoming records -- can all be done read-only. A user's primary profile downloads and applies very few unreconciled records.

The theory is that doing these on a read-only DB connection will allow the rest of the system to avoid contention.
(In reply to Richard Newman [:rnewman] from comment #2)
> The theory is that doing these on a read-only DB connection will allow the
> rest of the system to avoid contention.

Right, a connection clone increases concurrency on databases using WAL, at expense of using more memory though, since each connection has its own page cache.
Bug 660044 has a WIP patch that might be interesting.
Sync now uses public Places APIs.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.