Changeset 195499 in webkit


Ignore:
Timestamp:
Jan 22, 2016 5:48:39 PM (8 years ago)
Author:
beidson@apple.com
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:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195497 r195499  
     12016-01-22  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: Disable simultaneous transactions in the SQLite backend for now.
     4        https://bugs.webkit.org/show_bug.cgi?id=153381
     5
     6        Reviewed by Alex Christensen.
     7
     8        * platform/mac-wk1/TestExpectations:
     9
    1102016-01-22  Chris Dumez  <cdumez@apple.com>
    211
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r195495 r195499  
    255255imported/w3c/indexeddb/idbcursor-direction-index-keyrange.htm [ Failure ]
    256256imported/w3c/indexeddb/idbcursor-direction-index.htm [ Failure ]
     257imported/w3c/indexeddb/idbcursor-direction-objectstore-keyrange.htm [ Failure ]
     258imported/w3c/indexeddb/idbcursor-direction-objectstore.htm [ Failure ]
     259imported/w3c/indexeddb/idbcursor-direction.htm [ Failure ]
    257260imported/w3c/indexeddb/idbcursor-key.htm [ Failure ]
    258261imported/w3c/indexeddb/idbcursor-primarykey.htm [ Failure ]
     
    436439imported/w3c/indexeddb/value.htm [ Failure ]
    437440imported/w3c/indexeddb/value_recursive.htm [ Failure ]
     441imported/w3c/indexeddb/writer-starvation.htm [ Failure ]
    438442storage/indexeddb/createIndex-after-failure.html [ Failure ]
    439443storage/indexeddb/cursor-added-bug.html [ Failure ]
     
    559563storage/indexeddb/transaction-basics.html [ Failure ]
    560564storage/indexeddb/transaction-error.html [ Failure ]
     565storage/indexeddb/transaction-read-only.html [ Failure ]
    561566storage/indexeddb/transaction-rollback.html [ Failure ]
    562567storage/indexeddb/value-undefined.html [ Failure ]
     
    574579imported/w3c/indexeddb/idbobjectstore_openCursor_invalid.htm [ Skip ]
    575580imported/w3c/indexeddb/keypath.htm [ Skip ]
     581storage/indexeddb/closed-cursor.html [ Skip ]
     582storage/indexeddb/cursor-cast.html [ Skip ]
    576583storage/indexeddb/deletedatabase-transaction.html [ Skip ]
    577584storage/indexeddb/modern/blocked-open-db-requests.html [ Skip ]
     585storage/indexeddb/modern/transaction-scheduler-1.html [ Skip ]
     586storage/indexeddb/modern/transaction-scheduler-2.html [ Skip ]
    578587storage/indexeddb/modern/transaction-scheduler-4.html [ Skip ]
     588storage/indexeddb/modern/transaction-scheduler-5.html [ Skip ]
     589storage/indexeddb/modern/transaction-scheduler-6.html [ Skip ]
     590storage/indexeddb/noblobs.html [ Skip ]
     591storage/indexeddb/pending-activity.html [ Skip ]
    579592storage/indexeddb/prefetch-invalidation.html [ Skip ]
     593storage/indexeddb/prefetch-race.html [ Skip ]
    580594storage/indexeddb/primary-key-unique-to-objectstore.html [ Skip ]
     595storage/indexeddb/request-result-cache.html [ Skip ]
     596storage/indexeddb/transaction-coordination-within-database.html [ Skip ]
    581597storage/indexeddb/transaction-ordering.html [ Skip ]
    582 storage/indexeddb/closed-cursor.html [ Skip ]
    583 storage/indexeddb/cursor-cast.html [ Skip ]
    584 storage/indexeddb/noblobs.html [ Skip ]
    585 storage/indexeddb/prefetch-race.html [ Skip ]
    586 storage/indexeddb/request-result-cache.html [ Skip ]
    587 
    588 # SQLite backend tests that ASSERT
    589 imported/w3c/indexeddb/idbcursor-direction-objectstore-keyrange.htm [ Skip ]
    590 imported/w3c/indexeddb/idbcursor-direction-objectstore.htm [ Skip ]
    591 imported/w3c/indexeddb/idbcursor-direction.htm [ Skip ]
    592 imported/w3c/indexeddb/key_valid.html [ Skip ]
    593 imported/w3c/indexeddb/writer-starvation.htm [ Skip ]
    594 storage/indexeddb/database-close.html [ Skip ]
     598
     599# SQLite backend tests that crash or ASSERT
    595600storage/indexeddb/database-odd-names.html [ Skip ]
    596601storage/indexeddb/dont-wedge.html [ Skip ]
    597 storage/indexeddb/modern/transaction-scheduler-1.html [ Skip ]
    598 storage/indexeddb/modern/transaction-scheduler-2.html [ Skip ]
    599 storage/indexeddb/modern/transaction-scheduler-5.html [ Skip ]
    600 storage/indexeddb/modern/transaction-scheduler-6.html [ Skip ]
    601602storage/indexeddb/odd-strings.html [ Skip ]
    602 storage/indexeddb/pending-activity.html [ Skip ]
    603 storage/indexeddb/transaction-coordination-within-database.html [ Skip ]
    604 storage/indexeddb/transaction-overlapping.html [ Skip ]
    605 storage/indexeddb/transaction-read-only.html [ Skip ]
    606603
    607604# SQLite backend tests that wedge the entire testing harness
  • trunk/Source/WebCore/ChangeLog

    r195497 r195499  
     12016-01-22  Brady Eidson  <beidson@apple.com>
     2
     3        Modern IDB: Disable simultaneous transactions in the SQLite backend for now.
     4        https://bugs.webkit.org/show_bug.cgi?id=153381
     5
     6        Reviewed by Alex Christensen.
     7
     8        No new tests (This resolves many of the currently crashing/asserting tests).
     9
     10        Right now we're porting the Legacy IDB SQLite backend to Modern IDB.
     11       
     12        The way the Legacy backend works is restricted to one transaction at a time.
     13       
     14        There's many tricks we can play to resolve this, but that task is better performed
     15        once all of the basic functionality is done.
     16       
     17        Fixing this limitation is covered by https://bugs.webkit.org/show_bug.cgi?id=153382
     18
     19        * Modules/indexeddb/server/IDBBackingStore.h: Add a "supports simultaneous transactions" getter.
     20        * Modules/indexeddb/server/MemoryIDBBackingStore.h:
     21        * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
     22       
     23        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
     24        (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
     25        (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
     26        (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
     27        (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction): If the backing store does
     28          not support simultaneous transactions but there is a transaction in progress, return.
     29        * Modules/indexeddb/server/UniqueIDBDatabase.h:
     30
    1312016-01-22  Chris Dumez  <cdumez@apple.com>
    232
  • trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h

    r195467 r195499  
    7979
    8080    virtual void deleteBackingStore() = 0;
     81    virtual bool supportsSimultaneousTransactions() = 0;
    8182};
    8283
  • trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h

    r195467 r195499  
    7171
    7272    virtual void deleteBackingStore() override final;
     73    virtual bool supportsSimultaneousTransactions() override final { return true; }
    7374
    7475    void removeObjectStoreForVersionChangeAbort(MemoryObjectStore&);
  • trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.h

    r195495 r195499  
    7373
    7474    virtual void deleteBackingStore() override final;
     75    virtual bool supportsSimultaneousTransactions() override final { return false; }
    7576
    7677    void unregisterCursor(SQLiteIDBCursor&);
  • trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp

    r195467 r195499  
    210210        m_backingStore->deleteBackingStore();
    211211        m_backingStore = nullptr;
     212        m_backingStoreSupportsSimultaneousTransactions = false;
    212213    }
    213214
     
    447448    ASSERT(!m_backingStore);
    448449    m_backingStore = m_server.createBackingStore(identifier);
     450    m_backingStoreSupportsSimultaneousTransactions = m_backingStore->supportsSimultaneousTransactions();
    449451    auto databaseInfo = m_backingStore->getOrEstablishDatabaseInfo();
    450452
     
    10891091void UniqueIDBDatabase::enqueueTransaction(Ref<UniqueIDBDatabaseTransaction>&& transaction)
    10901092{
    1091     LOG(IndexedDB, "UniqueIDBDatabase::enqueueTransaction");
     1093    LOG(IndexedDB, "UniqueIDBDatabase::enqueueTransaction - %s", transaction->info().loggingString().utf8().data());
    10921094
    10931095    ASSERT(transaction->info().mode() != IndexedDB::TransactionMode::VersionChange);
     
    11841186RefPtr<UniqueIDBDatabaseTransaction> UniqueIDBDatabase::takeNextRunnableTransaction(bool& hadDeferredTransactions)
    11851187{
     1188    hadDeferredTransactions = false;
     1189    if (!m_backingStoreSupportsSimultaneousTransactions && !m_inProgressTransactions.isEmpty()) {
     1190        LOG(IndexedDB, "UniqueIDBDatabase::takeNextRunnableTransaction - Backing store only supports 1 transaction, and we already have 1");
     1191        return nullptr;
     1192    }
     1193
    11861194    Deque<RefPtr<UniqueIDBDatabaseTransaction>> deferredTransactions;
    11871195    RefPtr<UniqueIDBDatabaseTransaction> currentTransaction;
  • trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h

    r195467 r195499  
    196196    std::unique_ptr<IDBDatabaseInfo> m_mostRecentDeletedDatabaseInfo;
    197197
     198    bool m_backingStoreSupportsSimultaneousTransactions { false };
     199
    198200    HashMap<uint64_t, ErrorCallback> m_errorCallbacks;
    199201    HashMap<uint64_t, KeyDataCallback> m_keyDataCallbacks;
Note: See TracChangeset for help on using the changeset viewer.