Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLiteStorageArea should start new transaction when the previous one is rolled back by sqlite #9660

Conversation

szewai
Copy link
Contributor

@szewai szewai commented Feb 5, 2023

7833f1f

SQLiteStorageArea should start new transaction when the previous one is rolled back by sqlite
https://bugs.webkit.org/show_bug.cgi?id=251764
rdar://105061923

Reviewed by Chris Dumez.

When debugging storage_local_setitem_quotaexceedederr.window.html failure, I found SQLiteStorageArea does not start new
transaction after SQLITE_FULL error, which means it would create an implicit transaction for each statement. To fix
this, this patch makes startTransactionIfNecessary() check whether existing transaction is already rolled back. If the
transaction is rolled back, it should start a new transaction.

* Source/WebCore/platform/sql/SQLiteTransaction.h:
* Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp:
(WebKit::SQLiteStorageArea::startTransactionIfNecessary):

Canonical link: https://commits.webkit.org/259966@main

90e6d10

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style   πŸ›  ios   πŸ›  mac βœ… πŸ›  wpe   πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ›  gtk
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2   πŸ§ͺ api-mac   πŸ§ͺ gtk-wk2
  πŸ§ͺ api-ios   πŸ§ͺ mac-wk1   πŸ§ͺ api-gtk
  πŸ›  tv   πŸ§ͺ mac-wk2
  πŸ›  tv-sim   πŸ§ͺ mac-AS-debug-wk2
  πŸ›  watch   πŸ§ͺ mac-wk2-stress
βœ… πŸ›  πŸ§ͺ merge   πŸ›  watch-sim

@szewai szewai requested a review from cdumez as a code owner February 5, 2023 23:11
@szewai szewai self-assigned this Feb 5, 2023
@szewai szewai added the Website Storage Bugs related to storage APIs, including IndexedDB and localStorage label Feb 5, 2023
@szewai szewai requested a review from bnham February 6, 2023 17:04
@cdumez
Copy link
Contributor

cdumez commented Feb 6, 2023

0e6afe6

SQLiteStorageArea should start new transaction when the previous one is rolled back by sqlite
https://bugs.webkit.org/show_bug.cgi?id=251764
rdar://105061923

Reviewed by NOBODY (OOPS!).

When debugging storage_local_setitem_quotaexceedederr.window.html failure, I found SQLiteStorageArea does not start new
transaction after SQLITE_FULL error, which means it would create an implciti transaction for each INSERT statement. To
fix this, this patch makes startTransactionIfNecessary() check whether existing transaction is already rolled back. If
the transaction is rolled back, it should start a new transaction.

  • Source/WebCore/platform/sql/SQLiteTransaction.h:
  • Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp:
    (WebKit::SQLiteStorageArea::startTransactionIfNecessary):
    0e6afe6

Typo: implciti

@szewai szewai force-pushed the eng/SQLiteStorageArea-should-start-new-transaction-when-the-previous-one-is-rolled-back-by-sqlite branch from 0e6afe6 to 90e6d10 Compare February 7, 2023 17:20
@szewai szewai added the merge-queue Applied to send a pull request to merge-queue label Feb 7, 2023
…is rolled back by sqlite

https://bugs.webkit.org/show_bug.cgi?id=251764
rdar://105061923

Reviewed by Chris Dumez.

When debugging storage_local_setitem_quotaexceedederr.window.html failure, I found SQLiteStorageArea does not start new
transaction after SQLITE_FULL error, which means it would create an implicit transaction for each statement. To fix
this, this patch makes startTransactionIfNecessary() check whether existing transaction is already rolled back. If the
transaction is rolled back, it should start a new transaction.

* Source/WebCore/platform/sql/SQLiteTransaction.h:
* Source/WebKit/NetworkProcess/storage/SQLiteStorageArea.cpp:
(WebKit::SQLiteStorageArea::startTransactionIfNecessary):

Canonical link: https://commits.webkit.org/259966@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/SQLiteStorageArea-should-start-new-transaction-when-the-previous-one-is-rolled-back-by-sqlite branch from 90e6d10 to 7833f1f Compare February 7, 2023 18:14
@webkit-commit-queue
Copy link
Collaborator

Committed 259966@main (7833f1f): https://commits.webkit.org/259966@main

Reviewed commits have been landed. Closing PR #9660 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 7833f1f into WebKit:main Feb 7, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Website Storage Bugs related to storage APIs, including IndexedDB and localStorage
Projects
None yet
4 participants