Commit 190c0e45 authored by Daniel Murphy's avatar Daniel Murphy Committed by Commit Bot

[IndexedDB] Renamings and cleanups in Blob integration

This change does some renamings to match the terminology outlined here:
https://chromium.googlesource.com/chromium/src/+/master/content/browser/indexed_db/docs/README.md

It also adds more comments to the IndexedDBActiveBlobRegistry, and
splits up the method MarkDeletedCheckIfUsed into:
* MarkDatabaseDeletedAndCheckIfReferenced
* MarkBlobInfoDeletedAndCheckIfReferenced
and changes the following methods to be more accurate:
* AddBlobRef -> MarkBlobActive
* RemoveBlobRef -> MarkBlobInactive

Future CLs will continue renaming parts of the system to match the new
README.

Work planning doc:
https://docs.google.com/document/d/18suNOOzuEJbqgRJF0MB2VqdTyYqS4cvI2PGaCpyPXSw/edit?pli=1#heading=h.wwk24xdiduw5

R=enne@chromium.org

Bug: 1027737, 1024966
Change-Id: I3f569bad802e64eee2ccf55cacafbb170f099d14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1912828
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Auto-Submit: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarenne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718876}
parent 4de1c6cf
......@@ -23,92 +23,102 @@ IndexedDBActiveBlobRegistry::IndexedDBActiveBlobRegistry(
IndexedDBActiveBlobRegistry::~IndexedDBActiveBlobRegistry() {}
bool IndexedDBActiveBlobRegistry::MarkDeletedCheckIfUsed(int64_t database_id,
int64_t blob_key) {
bool IndexedDBActiveBlobRegistry::MarkDatabaseDeletedAndCheckIfReferenced(
int64_t database_id) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(KeyPrefix::IsValidDatabaseId(database_id));
const auto& db_pair = use_tracker_.find(database_id);
if (db_pair == use_tracker_.end())
const auto& db_pair = blob_reference_tracker_.find(database_id);
if (db_pair == blob_reference_tracker_.end())
return false;
if (blob_key == DatabaseMetaDataKey::kAllBlobsKey) {
deleted_dbs_.insert(database_id);
return true;
}
deleted_dbs_.insert(database_id);
return true;
}
bool IndexedDBActiveBlobRegistry::MarkBlobInfoDeletedAndCheckIfReferenced(
int64_t database_id,
int64_t blob_number) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK_NE(blob_number, DatabaseMetaDataKey::kAllBlobsKey);
DCHECK(KeyPrefix::IsValidDatabaseId(database_id));
const auto& db_pair = blob_reference_tracker_.find(database_id);
if (db_pair == blob_reference_tracker_.end())
return false;
SingleDBMap& single_db = db_pair->second;
auto iter = single_db.find(blob_key);
auto iter = single_db.find(blob_number);
if (iter == single_db.end())
return false;
iter->second = BlobState::kDeleted;
iter->second = BlobState::kUnlinked;
return true;
}
IndexedDBBlobInfo::ReleaseCallback
IndexedDBActiveBlobRegistry::GetFinalReleaseCallback(int64_t database_id,
int64_t blob_key) {
int64_t blob_number) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return base::BindRepeating(
&IndexedDBActiveBlobRegistry::ReleaseBlobRefThreadSafe,
&IndexedDBActiveBlobRegistry::MarkBlobInactiveThreadSafe,
base::SequencedTaskRunnerHandle::Get(), weak_factory_.GetWeakPtr(),
database_id, blob_key);
database_id, blob_number);
}
base::RepeatingClosure IndexedDBActiveBlobRegistry::GetAddBlobRefCallback(
base::RepeatingClosure IndexedDBActiveBlobRegistry::GetMarkBlobActiveCallback(
int64_t database_id,
int64_t blob_key) {
int64_t blob_number) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return base::BindRepeating(&IndexedDBActiveBlobRegistry::AddBlobRef,
weak_factory_.GetWeakPtr(), database_id, blob_key);
return base::BindRepeating(&IndexedDBActiveBlobRegistry::MarkBlobActive,
weak_factory_.GetWeakPtr(), database_id,
blob_number);
}
void IndexedDBActiveBlobRegistry::ForceShutdown() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
weak_factory_.InvalidateWeakPtrs();
use_tracker_.clear();
blob_reference_tracker_.clear();
report_outstanding_blobs_.Reset();
report_unused_blob_.Reset();
}
void IndexedDBActiveBlobRegistry::AddBlobRef(int64_t database_id,
int64_t blob_key) {
void IndexedDBActiveBlobRegistry::MarkBlobActive(int64_t database_id,
int64_t blob_number) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(report_outstanding_blobs_);
DCHECK(report_unused_blob_);
DCHECK(KeyPrefix::IsValidDatabaseId(database_id));
DCHECK(DatabaseMetaDataKey::IsValidBlobKey(blob_key));
DCHECK(DatabaseMetaDataKey::IsValidBlobKey(blob_number));
DCHECK(!base::Contains(deleted_dbs_, database_id));
bool outstanding_blobs_in_backing_store = !use_tracker_.empty();
SingleDBMap& blobs_in_db = use_tracker_[database_id];
auto iter = blobs_in_db.find(blob_key);
bool outstanding_blobs_in_backing_store = !blob_reference_tracker_.empty();
SingleDBMap& blobs_in_db = blob_reference_tracker_[database_id];
auto iter = blobs_in_db.find(blob_number);
if (iter == blobs_in_db.end()) {
blobs_in_db[blob_key] = BlobState::kAlive;
blobs_in_db[blob_number] = BlobState::kLinked;
if (!outstanding_blobs_in_backing_store)
report_outstanding_blobs_.Run(true);
} else {
DCHECK(outstanding_blobs_in_backing_store);
// You can't add a reference once it's been deleted.
DCHECK(iter->second == BlobState::kAlive);
DCHECK(iter->second == BlobState::kLinked);
}
}
void IndexedDBActiveBlobRegistry::ReleaseBlobRef(int64_t database_id,
int64_t blob_key) {
void IndexedDBActiveBlobRegistry::MarkBlobInactive(int64_t database_id,
int64_t blob_number) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(report_outstanding_blobs_);
DCHECK(report_unused_blob_);
DCHECK(KeyPrefix::IsValidDatabaseId(database_id));
DCHECK(DatabaseMetaDataKey::IsValidBlobKey(blob_key));
const auto& db_pair = use_tracker_.find(database_id);
if (db_pair == use_tracker_.end()) {
DCHECK(DatabaseMetaDataKey::IsValidBlobKey(blob_number));
const auto& db_pair = blob_reference_tracker_.find(database_id);
if (db_pair == blob_reference_tracker_.end()) {
NOTREACHED();
return;
}
SingleDBMap& blobs_in_db = db_pair->second;
auto blob_in_db_it = blobs_in_db.find(blob_key);
auto blob_in_db_it = blobs_in_db.find(blob_number);
if (blob_in_db_it == blobs_in_db.end()) {
NOTREACHED();
return;
......@@ -119,31 +129,31 @@ void IndexedDBActiveBlobRegistry::ReleaseBlobRef(int64_t database_id,
// Don't bother deleting the file if we're going to delete its whole
// database directory soon.
delete_blob_in_backend =
blob_in_db_it->second == BlobState::kDeleted && !db_marked_for_deletion;
blob_in_db_it->second == BlobState::kUnlinked && !db_marked_for_deletion;
blobs_in_db.erase(blob_in_db_it);
if (blobs_in_db.empty()) {
use_tracker_.erase(db_pair);
blob_reference_tracker_.erase(db_pair);
if (db_marked_for_deletion) {
delete_blob_in_backend = true;
blob_key = DatabaseMetaDataKey::kAllBlobsKey;
blob_number = DatabaseMetaDataKey::kAllBlobsKey;
deleted_dbs_.erase(deleted_database_it);
}
}
if (delete_blob_in_backend)
report_unused_blob_.Run(database_id, blob_key);
if (use_tracker_.empty())
report_unused_blob_.Run(database_id, blob_number);
if (blob_reference_tracker_.empty())
report_outstanding_blobs_.Run(false);
}
void IndexedDBActiveBlobRegistry::ReleaseBlobRefThreadSafe(
void IndexedDBActiveBlobRegistry::MarkBlobInactiveThreadSafe(
scoped_refptr<base::TaskRunner> task_runner,
base::WeakPtr<IndexedDBActiveBlobRegistry> weak_ptr,
int64_t database_id,
int64_t blob_key,
int64_t blob_number,
const base::FilePath& unused) {
task_runner->PostTask(
FROM_HERE, base::BindOnce(&IndexedDBActiveBlobRegistry::ReleaseBlobRef,
std::move(weak_ptr), database_id, blob_key));
FROM_HERE, base::BindOnce(&IndexedDBActiveBlobRegistry::MarkBlobInactive,
std::move(weak_ptr), database_id, blob_number));
}
} // namespace content
......@@ -21,10 +21,10 @@
namespace content {
// Keeps track of blobs that have been sent to the renderer as database
// responses, and determines when the file should be deleted. The database entry
// that the blob files live in could be deleted in the database, but the file
// would need to stay alive while it is still used in the renderer.
// Keeps track of blobs that have been sent to clients as database responses,
// and determines when Blob files can be deleted. The database entry that links
// to the blob file can be deleted in the database, but the blob file still
// needs to stay alive while it is still active (i.e. referenced by a client).
// This class must be used on a single sequence, and will call the given
// callbacks back on the same sequence it is constructed on.
class CONTENT_EXPORT IndexedDBActiveBlobRegistry {
......@@ -32,7 +32,7 @@ class CONTENT_EXPORT IndexedDBActiveBlobRegistry {
using ReportOutstandingBlobsCallback = base::RepeatingCallback<void(bool)>;
using ReportUnusedBlobCallback =
base::RepeatingCallback<void(int64_t /*database_id*/,
int64_t /*blob_key*/)>;
int64_t /*blob_number*/)>;
explicit IndexedDBActiveBlobRegistry(
ReportOutstandingBlobsCallback report_outstanding_blobs,
......@@ -40,48 +40,61 @@ class CONTENT_EXPORT IndexedDBActiveBlobRegistry {
~IndexedDBActiveBlobRegistry();
// Most methods of this class, and the closure returned by
// GetAddBlobRefCallback, should only be called on the backing_store's task
// runner. The exception is the closure returned by GetFinalReleaseCallback,
// which just calls ReleaseBlobRefThreadSafe.
// Marks a given blob or a while database as deleted by a transaction, and
// returns if the given blob key (or database) was previously used.
// Use DatabaseMetaDataKey::AllBlobsKey for "the whole database".
bool MarkDeletedCheckIfUsed(int64_t database_id, int64_t blob_key);
// GetMarkBlobActiveCallback, should only be called on the backing_store's
// task runner. The exception is the closure returned by
// GetFinalReleaseCallback, which just calls MarkBlobInactiveThreadSafe.
// Called when the given database is deleted (and all blob infos inside of
// it). Returns true if any of the deleted blobs are active (i.e. referenced
// by a client).
bool MarkDatabaseDeletedAndCheckIfReferenced(int64_t database_id);
// Called when the given blob handle is deleted by a transaction, and returns
// if the blob file has one or more external references.
bool MarkBlobInfoDeletedAndCheckIfReferenced(int64_t database_id,
int64_t blob_number);
// When called, the returned callback will mark the given blob entry as
// inactive (i.e. no longer referenced by a client).
IndexedDBBlobInfo::ReleaseCallback GetFinalReleaseCallback(
int64_t database_id,
int64_t blob_key);
// This closure holds a raw pointer to the IndexedDBActiveBlobRegistry,
// and may not be called after it is deleted.
base::RepeatingClosure GetAddBlobRefCallback(int64_t database_id,
int64_t blob_key);
int64_t blob_number);
// When called, the returned closure will mark the given blob entry as active
// (i.e. referenced by the client). Calling this multiple times does nothing.
// This closure holds a raw pointer to the IndexedDBActiveBlobRegistry, and
// may not be called after it is deleted.
base::RepeatingClosure GetMarkBlobActiveCallback(int64_t database_id,
int64_t blob_number);
// Call this to force the registry to drop its use counts, permitting the
// factory to drop any blob-related refcount for the backing store.
// This will also turn any outstanding callbacks into no-ops.
void ForceShutdown();
private:
enum class BlobState { kAlive, kDeleted };
// Maps blob_key -> BlobState; if the record's absent, it's not in active use
// and we don't care if it's deleted.
enum class BlobState { kLinked, kUnlinked };
// Maps blob_number -> BlobState; if the record's absent, it's not in active
// use and we don't care if it's deleted.
typedef std::map<int64_t, BlobState> SingleDBMap;
void AddBlobRef(int64_t database_id, int64_t blob_key);
void MarkBlobActive(int64_t database_id, int64_t blob_number);
// Removes a reference to the given blob.
void ReleaseBlobRef(int64_t database_id, int64_t blob_key);
static void ReleaseBlobRefThreadSafe(
void MarkBlobInactive(int64_t database_id, int64_t blob_number);
static void MarkBlobInactiveThreadSafe(
scoped_refptr<base::TaskRunner> task_runner,
base::WeakPtr<IndexedDBActiveBlobRegistry> weak_ptr,
int64_t database_id,
int64_t blob_key,
int64_t blob_number,
const base::FilePath& unused);
SEQUENCE_CHECKER(sequence_checker_);
std::map<int64_t, SingleDBMap> use_tracker_;
// Databases that have been marked as deleted by MarkDeletedCheckIfUsed.
// This stores, for every database, the blobs that are currently being used in
// that database.
std::map<int64_t, SingleDBMap> blob_reference_tracker_;
// Databases that have been marked as deleted by
// MarkDatabaseDeletedAndCheckIfReferenced.
std::set<int64_t> deleted_dbs_;
ReportOutstandingBlobsCallback report_outstanding_blobs_;
ReportUnusedBlobCallback report_unused_blob_;
......
......@@ -87,7 +87,8 @@ TEST_F(IndexedDBActiveBlobRegistryTest, DeleteUnused) {
EXPECT_TRUE(report_outstanding_state_.no_calls());
EXPECT_TRUE(unused_blobs_.empty());
EXPECT_FALSE(registry()->MarkDeletedCheckIfUsed(kDatabaseId0, kBlobKey0));
EXPECT_FALSE(registry()->MarkBlobInfoDeletedAndCheckIfReferenced(kDatabaseId0,
kBlobKey0));
RunUntilIdle();
EXPECT_TRUE(report_outstanding_state_.no_calls());
......@@ -99,7 +100,7 @@ TEST_F(IndexedDBActiveBlobRegistryTest, SimpleUse) {
EXPECT_TRUE(unused_blobs_.empty());
base::Closure add_ref =
registry()->GetAddBlobRefCallback(kDatabaseId0, kBlobKey0);
registry()->GetMarkBlobActiveCallback(kDatabaseId0, kBlobKey0);
ReleaseCallback release =
registry()->GetFinalReleaseCallback(kDatabaseId0, kBlobKey0);
std::move(add_ref).Run();
......@@ -122,7 +123,7 @@ TEST_F(IndexedDBActiveBlobRegistryTest, DeleteWhileInUse) {
EXPECT_TRUE(unused_blobs_.empty());
base::Closure add_ref =
registry()->GetAddBlobRefCallback(kDatabaseId0, kBlobKey0);
registry()->GetMarkBlobActiveCallback(kDatabaseId0, kBlobKey0);
ReleaseCallback release =
registry()->GetFinalReleaseCallback(kDatabaseId0, kBlobKey0);
......@@ -133,7 +134,8 @@ TEST_F(IndexedDBActiveBlobRegistryTest, DeleteWhileInUse) {
EXPECT_EQ(0, report_outstanding_state_.false_calls);
EXPECT_TRUE(unused_blobs_.empty());
EXPECT_TRUE(registry()->MarkDeletedCheckIfUsed(kDatabaseId0, kBlobKey0));
EXPECT_TRUE(registry()->MarkBlobInfoDeletedAndCheckIfReferenced(kDatabaseId0,
kBlobKey0));
RunUntilIdle();
EXPECT_EQ(1, report_outstanding_state_.true_calls);
......@@ -155,19 +157,19 @@ TEST_F(IndexedDBActiveBlobRegistryTest, MultipleBlobs) {
EXPECT_TRUE(unused_blobs_.empty());
base::Closure add_ref_00 =
registry()->GetAddBlobRefCallback(kDatabaseId0, kBlobKey0);
registry()->GetMarkBlobActiveCallback(kDatabaseId0, kBlobKey0);
ReleaseCallback release_00 =
registry()->GetFinalReleaseCallback(kDatabaseId0, kBlobKey0);
base::Closure add_ref_01 =
registry()->GetAddBlobRefCallback(kDatabaseId0, kBlobKey1);
registry()->GetMarkBlobActiveCallback(kDatabaseId0, kBlobKey1);
ReleaseCallback release_01 =
registry()->GetFinalReleaseCallback(kDatabaseId0, kBlobKey1);
base::Closure add_ref_10 =
registry()->GetAddBlobRefCallback(kDatabaseId1, kBlobKey0);
registry()->GetMarkBlobActiveCallback(kDatabaseId1, kBlobKey0);
ReleaseCallback release_10 =
registry()->GetFinalReleaseCallback(kDatabaseId1, kBlobKey0);
base::Closure add_ref_11 =
registry()->GetAddBlobRefCallback(kDatabaseId1, kBlobKey1);
registry()->GetMarkBlobActiveCallback(kDatabaseId1, kBlobKey1);
ReleaseCallback release_11 =
registry()->GetFinalReleaseCallback(kDatabaseId1, kBlobKey1);
......@@ -188,7 +190,8 @@ TEST_F(IndexedDBActiveBlobRegistryTest, MultipleBlobs) {
EXPECT_EQ(0, report_outstanding_state_.false_calls);
EXPECT_TRUE(unused_blobs_.empty());
EXPECT_TRUE(registry()->MarkDeletedCheckIfUsed(kDatabaseId0, kBlobKey1));
EXPECT_TRUE(registry()->MarkBlobInfoDeletedAndCheckIfReferenced(kDatabaseId0,
kBlobKey1));
RunUntilIdle();
EXPECT_EQ(1, report_outstanding_state_.true_calls);
......@@ -220,11 +223,11 @@ TEST_F(IndexedDBActiveBlobRegistryTest, ForceShutdown) {
EXPECT_TRUE(unused_blobs_.empty());
base::Closure add_ref_0 =
registry()->GetAddBlobRefCallback(kDatabaseId0, kBlobKey0);
registry()->GetMarkBlobActiveCallback(kDatabaseId0, kBlobKey0);
ReleaseCallback release_0 =
registry()->GetFinalReleaseCallback(kDatabaseId0, kBlobKey0);
base::Closure add_ref_1 =
registry()->GetAddBlobRefCallback(kDatabaseId0, kBlobKey1);
registry()->GetMarkBlobActiveCallback(kDatabaseId0, kBlobKey1);
ReleaseCallback release_1 =
registry()->GetFinalReleaseCallback(kDatabaseId0, kBlobKey1);
......
......@@ -424,7 +424,7 @@ class CONTENT_EXPORT IndexedDBBackingStore {
// Initializes the backing store. This must be called before doing any
// operations or method calls on this object.
leveldb::Status Initialize(bool clean_live_blob_journal);
leveldb::Status Initialize(bool clean_active_blob_journal);
const url::Origin& origin() const { return origin_; }
base::SequencedTaskRunner* task_runner() const { return task_runner_.get(); }
......@@ -518,7 +518,7 @@ class CONTENT_EXPORT IndexedDBBackingStore {
std::unique_ptr<blink::IndexedDBKey>* found_primary_key,
bool* exists) WARN_UNUSED_RESULT;
// Public for IndexedDBActiveBlobRegistry::ReleaseBlobRef.
// Public for IndexedDBActiveBlobRegistry::MarkBlobInactive.
virtual void ReportBlobUnused(int64_t database_id, int64_t blob_key);
base::FilePath GetBlobFileName(int64_t database_id, int64_t key) const;
......@@ -613,16 +613,16 @@ class CONTENT_EXPORT IndexedDBBackingStore {
// Remove the referenced file on disk.
virtual bool RemoveBlobFile(int64_t database_id, int64_t key) const;
// Schedule a call to CleanPrimaryJournalIgnoreReturn() via
// Schedule a call to CleanRecoveryJournalIgnoreReturn() via
// an owned timer. If this object is destroyed, the timer
// will automatically be cancelled.
virtual void StartJournalCleaningTimer();
// Attempt to clean the primary journal. This will remove
// Attempt to clean the recovery journal. This will remove
// any referenced files and delete the journal entry. If any
// transaction is currently committing this will be deferred
// via StartJournalCleaningTimer().
void CleanPrimaryJournalIgnoreReturn();
void CleanRecoveryJournalIgnoreReturn();
private:
leveldb::Status FindKeyInIndex(
......
......@@ -904,7 +904,7 @@ TEST_F(IndexedDBBackingStoreTestWithBlobs, BlobJournalInterleavedTransactions) {
RunAllTasksUntilIdle();
}
TEST_F(IndexedDBBackingStoreTestWithBlobs, LiveBlobJournal) {
TEST_F(IndexedDBBackingStoreTestWithBlobs, ActiveBlobJournal) {
std::unique_ptr<IndexedDBBackingStore::Transaction> transaction1;
TestCallback callback_creator1;
std::unique_ptr<IndexedDBBackingStore::Transaction> transaction3;
......
......@@ -919,8 +919,8 @@ IndexedDBFactoryImpl::OpenAndVerifyIndexedDBBackingStore(
weak_factory_.GetWeakPtr(), origin),
context_->TaskRunner());
status = backing_store->Initialize(
/*cleanup_live_journal=*/(!is_incognito_and_in_memory &&
first_open_since_startup));
/*cleanup_active_journal=*/(!is_incognito_and_in_memory &&
first_open_since_startup));
if (UNLIKELY(!status.ok()))
return {nullptr, status, IndexedDBDataLossInfo(), /*is_disk_full=*/false};
......
......@@ -63,8 +63,8 @@ constexpr unsigned char kBlobEntryIndexId = 3;
constexpr unsigned char kSchemaVersionTypeByte = 0;
constexpr unsigned char kMaxDatabaseIdTypeByte = 1;
constexpr unsigned char kDataVersionTypeByte = 2;
constexpr unsigned char kBlobJournalTypeByte = 3;
constexpr unsigned char kLiveBlobJournalTypeByte = 4;
constexpr unsigned char kRecoveryBlobJournalTypeByte = 3;
constexpr unsigned char kActiveBlobJournalTypeByte = 4;
constexpr unsigned char kEarliestSweepTimeTypeByte = 5;
constexpr unsigned char kMaxSimpleGlobalMetaDataTypeByte =
6; // Insert before this and increment.
......@@ -1013,11 +1013,11 @@ std::string IndexedDBKeyToDebugString(base::StringPiece key) {
case kDataVersionTypeByte:
result << "kDataVersionTypeByte";
break;
case kBlobJournalTypeByte:
result << "kBlobJournalTypeByte";
case kRecoveryBlobJournalTypeByte:
result << "kRecoveryBlobJournalTypeByte";
break;
case kLiveBlobJournalTypeByte:
result << "kLiveBlobJournalTypeByte";
case kActiveBlobJournalTypeByte:
result << "kActiveBlobJournalTypeByte";
break;
case kEarliestSweepTimeTypeByte:
result << "kEarliestSweepTimeTypeByte";
......@@ -1444,15 +1444,15 @@ std::string DataVersionKey::Encode() {
return ret;
}
std::string BlobJournalKey::Encode() {
std::string RecoveryBlobJournalKey::Encode() {
std::string ret = KeyPrefix::EncodeEmpty();
ret.push_back(kBlobJournalTypeByte);
ret.push_back(kRecoveryBlobJournalTypeByte);
return ret;
}
std::string LiveBlobJournalKey::Encode() {
std::string ActiveBlobJournalKey::Encode() {
std::string ret = KeyPrefix::EncodeEmpty();
ret.push_back(kLiveBlobJournalTypeByte);
ret.push_back(kActiveBlobJournalTypeByte);
return ret;
}
......
......@@ -225,12 +225,12 @@ class DataVersionKey {
CONTENT_EXPORT static std::string Encode();
};
class BlobJournalKey {
class RecoveryBlobJournalKey {
public:
static std::string Encode();
};
class LiveBlobJournalKey {
class ActiveBlobJournalKey {
public:
static std::string Encode();
};
......
......@@ -151,8 +151,8 @@ key | value
«0, 0, 0, 0» | backing store schema version (Int) [`SchemaVersionKey`]
«0, 0, 0, 1» | maximum allocated database (Int) [`MaxDatabaseIdKey`]
«0, 0, 0, 2» | data format version (Int) [`DataVersionKey`]
«0, 0, 0, 3» | primary BlobJournal [`BlobJournalKey`]
«0, 0, 0, 4» | live BlobJournal [`LiveBlobJournalKey`]
«0, 0, 0, 3» | recovery BlobJournal [`RecoveryBlobJournalKey`]
«0, 0, 0, 4» | active BlobJournal [`ActiveBlobJournalKey`]
«0, 0, 0, 5» | earliest sweep time (microseconds) (Int) [`EarliestSweepKey`]
«0, 0, 0, 100, database id (VarInt)» | Existence implies the database id is in the free list [`DatabaseFreeListKey`] - _obsolete_
«0, 0, 0, 201, origin (StringWithLength), database name (StringWithLength)» | Database id (Int) [`DatabaseNameKey`]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment