0
Commit Graph

12 Commits

Author SHA1 Message Date
Austin Sullivan
f79ebbba93 sql: Remove kConsiderPoisonedDatabasesClosed feature flag
This flag was added in M118
https://crrev.com/6c6faa56ae799a6781ba59bb11a2c453637f1910

Fixed: 1441955
Change-Id: Id414b250f3e6d38ce9bf7108c48eef43be02a306
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5167271
Commit-Queue: Evan Stade <estade@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Auto-Submit: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1243089}
2024-01-04 20:35:22 +00:00
Austin Sullivan
6c6faa56ae sql: Consider poisoned databases closed
This feature is enabled by default, but is gated behind a new base
feature flag. It builds on the changes behind the kClearDbIfCloseFails
flag. Rather than adding a new flag whose value would depend on this
older flag, this CL simply removes the older flag, which has been on
stable for almost two milestones and is therefore removable according
to the flag-guarding guidelines.

Bug: 1441955
Change-Id: Idabc75fc69250976a907dfe4e554cc9f204b21fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4499396
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1184284}
2023-08-16 18:32:37 +00:00
Austin Sullivan
265c201be9 sql: Add wrapper to facilitate migration to the new recovery module
This new method decides internally whether to use the new
`sql::BuiltInRecovery` or the legacy `sql::Recovery`, based on
feature flags and availability. It is intended to facilitate the
migration to the newer recovery module with minimal impact on feature
teams. The expectation is that the branch which uses `sql::Recovery`
will eventually become obsolete and be removed entirely.

Adds a new kill switch which may disable all use of `BuiltInRecovery`
if necessary.

Also updates the test suites to remove use of `if (!BuiltIn()) ...`

Bug: 1385500
Change-Id: Idaeab746c7a257b1eda2f1ec02c6525c7473bcdc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4570917
Reviewed-by: Evan Stade <estade@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1151027}
2023-05-31 02:04:26 +00:00
Austin Sullivan
310048ef7e sql: Clear database connection member if opening database fails
According to https://www.sqlite.org/c3ref/open.html:

  A database connection handle is usually returned in *ppDb,
  even if an error occurs.

Unfortunately, is_open() simply checks whether the database connection
member exists, which means that is_open() effectively behaves as
has_called_sqlite3_open_v2()

As a follow-up, we should consider making is_open() check poisoned_

Bug: 1423640, 1441955
Change-Id: Ia29b1d42e4f0bff2580af53d2804b569b28c2de9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4499308
Reviewed-by: Evan Stade <estade@chromium.org>
Auto-Submit: Austin Sullivan <asully@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1139641}
2023-05-04 17:28:33 +00:00
Daniel Cheng
4f45ff9316 Use helper macros to define base::Features in //sql
This allows:
- features to be defined with a consistent set of qualifiers, and for
  that set of qualifiers to be updated over time as appropriate.
- better PRESUBMIT checks to ensure that base::Features are not defined
  in headers.
- simplifies things for scripts trying to extract feature definitions
  out of C++ code.

The primary CL was generated using a script that automatically rewrites
base::Feature declarations and definitions to the macro form. Changes to
any files with known incompatibilities with the macros (base::Features
without static storage duration and base::Features declared as static
class members) were then fully reverted; those changes will be manually
handled in followups.

This CL was uploaded by git cl split.

R=asully@chromium.org

Bug: 1364289
Change-Id: Ib72314440a729540f22a58022fab85cab5dc6a19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3923023
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1052139}
2022-09-28 00:47:35 +00:00
Avi Drissman
69b874fee0 Update copyright headers in sql/, storage/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c95.

No-Try: true
Bug: 1098010
Change-Id: I68bb81a4dcae37f944f4d8cd39d82ed540364615
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3899461
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047607}
2022-09-15 19:11:14 +00:00
Caitlin Fischer
598a10e937 Clean up SqlSkipPreload feature.
Bug: 1126640
Change-Id: I87de57b6c22c6b2f7bda8c6ca6a8b501436f863b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2435327
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Commit-Queue: Caitlin Fischer <caitlinfischer@google.com>
Cr-Commit-Position: refs/heads/master@{#812006}
2020-09-30 14:28:25 +00:00
Shubham Aggarwal
be4f97ce11 SQLite: Add support for WAL mode
As per issue 78507, we are looking to add support for SQLite databases
to use Write-ahead logging (https://www.sqlite.org/wal.html) mode in
Chromium. WAL mode should give us significant performance gains across
almost all use-cases.

This change is a first step towards achieving this. It adds opt-in
support to enable WAL mode for a database connection and perform a
checkpoint. It also adds a feature flag to enable WAL mode for all
databases by default to investigate its feasibility and impact on
performance.

Bug: 78507
Change-Id: I7fc5edcc39b50d2a13755d587cf342bded1af60a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095927
Commit-Queue: Shubham Aggarwal <shuagga@microsoft.com>
Reviewed-by: Brandon Maslen <brandm@microsoft.com>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Chris Mumford <cmumford@google.com>
Cr-Commit-Position: refs/heads/master@{#780318}
2020-06-19 15:58:57 +00:00
Victor Costan
3ffd9a3731 sql: Add Finch trial for eliminating sql::Database::Preload().
The logic in sql::Database::Preload() is a pessimization for modern OS
schedulers, as it forces the kernel to read the first few pages of a
newly opened database. https://crbug.com/243949 suggests that this
method was added without performance testing, just like the more complex
SQLite patch that it replaces.

This CL sets up a Finch trial that will either prove that we can get rid
of the Preload() hack, or give us conclusive data about its usefulness.

Bug: 243949
Change-Id: Icfee9aaa3d125af207974536e8e5f5e64a9609ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1438031
Reviewed-by: Steven Holte <holte@chromium.org>
Reviewed-by: Chris Mumford <cmumford@google.com>
Commit-Queue: Steven Holte <holte@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662006}
2019-05-22 00:46:54 +00:00
Victor Costan
249be7083d sql: Remove SqlTempStoreMemory experiment.
All the necessary data has been collected. This CL undoes the parts of
https://crrev.com/c/1180530 and https://crrev.com/c/1183786 that were
not general code health improvements.

Bug: 875538
Change-Id: Ibd604c69996072db71c47b18b99f79962f389c3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1612266
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: Chris Mumford <cmumford@google.com>
Reviewed-by: Steven Holte <holte@chromium.org>
Commit-Queue: Steven Holte <holte@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660615}
2019-05-16 22:24:10 +00:00
Victor Costan
e56cc68b9c sql: Switch from custom macro to COMPONENT_EXPORT.
TBR: jsbell
Change-Id: I5b998afa31810577e0bfd9d4d29ef9d462bce5b7
Reviewed-on: https://chromium-review.googlesource.com/c/1390332
Reviewed-by: Victor Costan <pwnall@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618989}
2018-12-27 01:53:46 +00:00
Victor Costan
4c2f3e9227 sql: Feature flag for in-memory temporary storage.
This CL introduces SqlTempStoreMemory flag, which is intended to be
managed via Finch. When set, the flag causes sql::Database to run a
PRAGMA temp_store=MEMORY [1] query on every opened database.

This approach is intended to approximate the effect of building SQLite
with the SQLITE_TEMP_STORE=3 [2] macro, to measure the memory
consumption impact. Ideally, we'd test the macro directly, but //sql is
a core component of Chrome, so we can't load different versions of it
based on Finch.

[1] https://www.sqlite.org/pragma.html#pragma_temp_store
[2] https://www.sqlite.org/compile.html#temp_store

Bug: 875538
Change-Id: I537d90d763be1100503ed4bd2ada2ee19eb090bb
Reviewed-on: https://chromium-review.googlesource.com/1180530
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Reviewed-by: Chris Mumford <cmumford@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584652}
2018-08-21 04:47:59 +00:00