- Revision
- 195499
- Author
- [email protected]
- Date
- 2016-01-22 17:48:39 -0800 (Fri, 22 Jan 2016)
Log Message
Modern IDB: Disable simultaneous transactions in the SQLite backend for now.
https://bugs.webkit.org/show_bug.cgi?id=153381
Reviewed by Alex Christensen.
Source/WebCore:
No new tests (This resolves many of the currently crashing/asserting tests).
Right now we're porting the Legacy IDB SQLite backend to Modern IDB.
The way the Legacy backend works is restricted to one transaction at a time.
There's many tricks we can play to resolve this, but that task is better performed
once all of the basic functionality is done.
Fixing this limitation is covered by https://bugs.webkit.org/show_bug.cgi?id=153382
* Modules/indexeddb/server/IDBBackingStore.h: Add a "supports simultaneous transactions" getter.
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction): If the backing store does
not support simultaneous transactions but there is a transaction in progress, return.
* Modules/indexeddb/server/UniqueIDBDatabase.h:
LayoutTests:
* platform/mac-wk1/TestExpectations:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (195498 => 195499)
--- trunk/LayoutTests/ChangeLog 2016-01-23 01:32:02 UTC (rev 195498)
+++ trunk/LayoutTests/ChangeLog 2016-01-23 01:48:39 UTC (rev 195499)
@@ -1,3 +1,12 @@
+2016-01-22 Brady Eidson <[email protected]>
+
+ Modern IDB: Disable simultaneous transactions in the SQLite backend for now.
+ https://bugs.webkit.org/show_bug.cgi?id=153381
+
+ Reviewed by Alex Christensen.
+
+ * platform/mac-wk1/TestExpectations:
+
2016-01-22 Chris Dumez <[email protected]>
document.charset should be an alias for document.characterSet
Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (195498 => 195499)
--- trunk/LayoutTests/platform/mac-wk1/TestExpectations 2016-01-23 01:32:02 UTC (rev 195498)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations 2016-01-23 01:48:39 UTC (rev 195499)
@@ -254,6 +254,9 @@
imported/w3c/indexeddb/cursor-overloads.htm [ Failure ]
imported/w3c/indexeddb/idbcursor-direction-index-keyrange.htm [ Failure ]
imported/w3c/indexeddb/idbcursor-direction-index.htm [ Failure ]
+imported/w3c/indexeddb/idbcursor-direction-objectstore-keyrange.htm [ Failure ]
+imported/w3c/indexeddb/idbcursor-direction-objectstore.htm [ Failure ]
+imported/w3c/indexeddb/idbcursor-direction.htm [ Failure ]
imported/w3c/indexeddb/idbcursor-key.htm [ Failure ]
imported/w3c/indexeddb/idbcursor-primarykey.htm [ Failure ]
imported/w3c/indexeddb/idbcursor-reused.htm [ Failure ]
@@ -435,6 +438,7 @@
imported/w3c/indexeddb/transaction_bubble-and-capture.htm [ Failure ]
imported/w3c/indexeddb/value.htm [ Failure ]
imported/w3c/indexeddb/value_recursive.htm [ Failure ]
+imported/w3c/indexeddb/writer-starvation.htm [ Failure ]
storage/indexeddb/createIndex-after-failure.html [ Failure ]
storage/indexeddb/cursor-added-bug.html [ Failure ]
storage/indexeddb/cursor-advance.html [ Failure ]
@@ -558,6 +562,7 @@
storage/indexeddb/transaction-and-objectstore-calls.html [ Failure ]
storage/indexeddb/transaction-basics.html [ Failure ]
storage/indexeddb/transaction-error.html [ Failure ]
+storage/indexeddb/transaction-read-only.html [ Failure ]
storage/indexeddb/transaction-rollback.html [ Failure ]
storage/indexeddb/value-undefined.html [ Failure ]
storage/indexeddb/values-odd-types.html [ Failure ]
@@ -573,36 +578,28 @@
imported/w3c/indexeddb/idbindex-multientry-big.htm [ Skip ]
imported/w3c/indexeddb/idbobjectstore_openCursor_invalid.htm [ Skip ]
imported/w3c/indexeddb/keypath.htm [ Skip ]
+storage/indexeddb/closed-cursor.html [ Skip ]
+storage/indexeddb/cursor-cast.html [ Skip ]
storage/indexeddb/deletedatabase-transaction.html [ Skip ]
storage/indexeddb/modern/blocked-open-db-requests.html [ Skip ]
+storage/indexeddb/modern/transaction-scheduler-1.html [ Skip ]
+storage/indexeddb/modern/transaction-scheduler-2.html [ Skip ]
storage/indexeddb/modern/transaction-scheduler-4.html [ Skip ]
-storage/indexeddb/prefetch-invalidation.html [ Skip ]
-storage/indexeddb/primary-key-unique-to-objectstore.html [ Skip ]
-storage/indexeddb/transaction-ordering.html [ Skip ]
-storage/indexeddb/closed-cursor.html [ Skip ]
-storage/indexeddb/cursor-cast.html [ Skip ]
+storage/indexeddb/modern/transaction-scheduler-5.html [ Skip ]
+storage/indexeddb/modern/transaction-scheduler-6.html [ Skip ]
storage/indexeddb/noblobs.html [ Skip ]
+storage/indexeddb/pending-activity.html [ Skip ]
+storage/indexeddb/prefetch-invalidation.html [ Skip ]
storage/indexeddb/prefetch-race.html [ Skip ]
+storage/indexeddb/primary-key-unique-to-objectstore.html [ Skip ]
storage/indexeddb/request-result-cache.html [ Skip ]
+storage/indexeddb/transaction-coordination-within-database.html [ Skip ]
+storage/indexeddb/transaction-ordering.html [ Skip ]
-# SQLite backend tests that ASSERT
-imported/w3c/indexeddb/idbcursor-direction-objectstore-keyrange.htm [ Skip ]
-imported/w3c/indexeddb/idbcursor-direction-objectstore.htm [ Skip ]
-imported/w3c/indexeddb/idbcursor-direction.htm [ Skip ]
-imported/w3c/indexeddb/key_valid.html [ Skip ]
-imported/w3c/indexeddb/writer-starvation.htm [ Skip ]
-storage/indexeddb/database-close.html [ Skip ]
+# SQLite backend tests that crash or ASSERT
storage/indexeddb/database-odd-names.html [ Skip ]
storage/indexeddb/dont-wedge.html [ Skip ]
-storage/indexeddb/modern/transaction-scheduler-1.html [ Skip ]
-storage/indexeddb/modern/transaction-scheduler-2.html [ Skip ]
-storage/indexeddb/modern/transaction-scheduler-5.html [ Skip ]
-storage/indexeddb/modern/transaction-scheduler-6.html [ Skip ]
storage/indexeddb/odd-strings.html [ Skip ]
-storage/indexeddb/pending-activity.html [ Skip ]
-storage/indexeddb/transaction-coordination-within-database.html [ Skip ]
-storage/indexeddb/transaction-overlapping.html [ Skip ]
-storage/indexeddb/transaction-read-only.html [ Skip ]
# SQLite backend tests that wedge the entire testing harness
imported/w3c/indexeddb/keyorder.htm [ Skip ]
Modified: trunk/Source/WebCore/ChangeLog (195498 => 195499)
--- trunk/Source/WebCore/ChangeLog 2016-01-23 01:32:02 UTC (rev 195498)
+++ trunk/Source/WebCore/ChangeLog 2016-01-23 01:48:39 UTC (rev 195499)
@@ -1,3 +1,33 @@
+2016-01-22 Brady Eidson <[email protected]>
+
+ Modern IDB: Disable simultaneous transactions in the SQLite backend for now.
+ https://bugs.webkit.org/show_bug.cgi?id=153381
+
+ Reviewed by Alex Christensen.
+
+ No new tests (This resolves many of the currently crashing/asserting tests).
+
+ Right now we're porting the Legacy IDB SQLite backend to Modern IDB.
+
+ The way the Legacy backend works is restricted to one transaction at a time.
+
+ There's many tricks we can play to resolve this, but that task is better performed
+ once all of the basic functionality is done.
+
+ Fixing this limitation is covered by https://bugs.webkit.org/show_bug.cgi?id=153382
+
+ * Modules/indexeddb/server/IDBBackingStore.h: Add a "supports simultaneous transactions" getter.
+ * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+ * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
+
+ * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
+ (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
+ (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
+ (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction): If the backing store does
+ not support simultaneous transactions but there is a transaction in progress, return.
+ * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
2016-01-22 Chris Dumez <[email protected]>
document.charset should be an alias for document.characterSet
Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h (195498 => 195499)
--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h 2016-01-23 01:32:02 UTC (rev 195498)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h 2016-01-23 01:48:39 UTC (rev 195499)
@@ -78,6 +78,7 @@
virtual IDBError iterateCursor(const IDBResourceIdentifier& transactionIdentifier, const IDBResourceIdentifier& cursorIdentifier, const IDBKeyData&, uint32_t count, IDBGetResult& outResult) = 0;
virtual void deleteBackingStore() = 0;
+ virtual bool supportsSimultaneousTransactions() = 0;
};
} // namespace IDBServer
Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h (195498 => 195499)
--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h 2016-01-23 01:32:02 UTC (rev 195498)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h 2016-01-23 01:48:39 UTC (rev 195499)
@@ -70,6 +70,7 @@
virtual IDBError iterateCursor(const IDBResourceIdentifier& transactionIdentifier, const IDBResourceIdentifier& cursorIdentifier, const IDBKeyData&, uint32_t count, IDBGetResult& outResult) override final;
virtual void deleteBackingStore() override final;
+ virtual bool supportsSimultaneousTransactions() override final { return true; }
void removeObjectStoreForVersionChangeAbort(MemoryObjectStore&);
void restoreObjectStoreForVersionChangeAbort(Ref<MemoryObjectStore>&&);
Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h (195498 => 195499)
--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h 2016-01-23 01:32:02 UTC (rev 195498)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h 2016-01-23 01:48:39 UTC (rev 195499)
@@ -72,6 +72,7 @@
virtual IDBError iterateCursor(const IDBResourceIdentifier& transactionIdentifier, const IDBResourceIdentifier& cursorIdentifier, const IDBKeyData&, uint32_t count, IDBGetResult& outResult) override final;
virtual void deleteBackingStore() override final;
+ virtual bool supportsSimultaneousTransactions() override final { return false; }
void unregisterCursor(SQLiteIDBCursor&);
Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (195498 => 195499)
--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp 2016-01-23 01:32:02 UTC (rev 195498)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp 2016-01-23 01:48:39 UTC (rev 195499)
@@ -209,6 +209,7 @@
if (m_backingStore) {
m_backingStore->deleteBackingStore();
m_backingStore = nullptr;
+ m_backingStoreSupportsSimultaneousTransactions = false;
}
m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didDeleteBackingStore));
@@ -446,6 +447,7 @@
ASSERT(!m_backingStore);
m_backingStore = m_server.createBackingStore(identifier);
+ m_backingStoreSupportsSimultaneousTransactions = m_backingStore->supportsSimultaneousTransactions();
auto databaseInfo = m_backingStore->getOrEstablishDatabaseInfo();
m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didOpenBackingStore, databaseInfo));
@@ -1088,7 +1090,7 @@
void UniqueIDBDatabase::enqueueTransaction(Ref<UniqueIDBDatabaseTransaction>&& transaction)
{
- LOG(IndexedDB, "UniqueIDBDatabase::enqueueTransaction");
+ LOG(IndexedDB, "UniqueIDBDatabase::enqueueTransaction - %s", transaction->info().loggingString().utf8().data());
ASSERT(transaction->info().mode() != IndexedDB::TransactionMode::VersionChange);
@@ -1183,6 +1185,12 @@
RefPtr<UniqueIDBDatabaseTransaction> UniqueIDBDatabase::takeNextRunnableTransaction(bool& hadDeferredTransactions)
{
+ hadDeferredTransactions = false;
+ if (!m_backingStoreSupportsSimultaneousTransactions && !m_inProgressTransactions.isEmpty()) {
+ LOG(IndexedDB, "UniqueIDBDatabase::takeNextRunnableTransaction - Backing store only supports 1 transaction, and we already have 1");
+ return nullptr;
+ }
+
Deque<RefPtr<UniqueIDBDatabaseTransaction>> deferredTransactions;
RefPtr<UniqueIDBDatabaseTransaction> currentTransaction;
Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (195498 => 195499)
--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h 2016-01-23 01:32:02 UTC (rev 195498)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h 2016-01-23 01:48:39 UTC (rev 195499)
@@ -195,6 +195,8 @@
std::unique_ptr<IDBDatabaseInfo> m_databaseInfo;
std::unique_ptr<IDBDatabaseInfo> m_mostRecentDeletedDatabaseInfo;
+ bool m_backingStoreSupportsSimultaneousTransactions { false };
+
HashMap<uint64_t, ErrorCallback> m_errorCallbacks;
HashMap<uint64_t, KeyDataCallback> m_keyDataCallbacks;
HashMap<uint64_t, GetResultCallback> m_getResultCallbacks;