Fix apply table metadata updates

This commit is contained in:
Nik Bougalis
2015-07-20 12:36:49 -07:00
parent e18ba24670
commit e7a50e2a5a

View File

@@ -404,7 +404,7 @@ ApplyStateTable::insert (ReadView const& base,
case Action::cache: case Action::cache:
LogicError("ApplyStateTable::insert: already cached"); LogicError("ApplyStateTable::insert: already cached");
case Action::insert: case Action::insert:
LogicError("ApplyStateTable::insert: already inserted"); LogicError("ApplyStateTable::insert: already inserted");
case Action::modify: case Action::modify:
LogicError("ApplyStateTable::insert: already modified"); LogicError("ApplyStateTable::insert: already modified");
case Action::erase: case Action::erase:
@@ -504,7 +504,7 @@ ApplyStateTable::getForMod (ReadView const& base,
auto iter = items_.find (key); auto iter = items_.find (key);
if (iter != items_.end ()) if (iter != items_.end ())
{ {
auto const& item = iter->second; auto& item = iter->second;
if (item.first == Action::erase) if (item.first == Action::erase)
{ {
// VFALCO We need to think about throwing // VFALCO We need to think about throwing
@@ -513,6 +513,9 @@ ApplyStateTable::getForMod (ReadView const& base,
"Trying to thread to deleted node"; "Trying to thread to deleted node";
return nullptr; return nullptr;
} }
// Track when a node gets modified only by metadata
if (item.first == Action::cache)
item.first = Action::modify;
return item.second; return item.second;
} }
{ {