@@ -25,10 +25,6 @@ namespace ccf::kv
25
25
// sets to their underlying Maps. Calls f() at most once, iff the writes are
26
26
// applied, to retrieve a unique Version for the write set and return the max
27
27
// version which can have a conflict with the transaction.
28
- //
29
- // The track_read_versions parameter tells the store if it needs to track the
30
- // last read version for every key. This is required for backup execution as
31
- // described at the top of tx.h
32
28
33
29
using VersionLastNewMap = Version;
34
30
using VersionResolver = std::function<std::tuple<Version, VersionLastNewMap>(
@@ -40,7 +36,6 @@ namespace ccf::kv
40
36
ccf::kv::ConsensusHookPtrs& hooks,
41
37
const MapCollection& new_maps,
42
38
const std::optional<Version>& new_maps_conflict_version,
43
- bool track_read_versions,
44
39
bool track_deletes_on_missing_keys,
45
40
const std::optional<Version>& expected_rollback_count = std::nullopt)
46
41
{
@@ -88,7 +83,7 @@ namespace ccf::kv
88
83
{
89
84
for (auto it = views.begin (); it != views.end (); ++it)
90
85
{
91
- if (!it->second ->prepare (track_read_versions ))
86
+ if (!it->second ->prepare ())
92
87
{
93
88
ok = false ;
94
89
break ;
@@ -132,40 +127,31 @@ namespace ccf::kv
132
127
std::tie (version, version_last_new_map) =
133
128
version_resolver_fn (!new_maps.empty ());
134
129
135
- if (!track_read_versions)
130
+ // Transfer ownership of these new maps to their target stores, iff we
131
+ // have writes to them
132
+ for (const auto & [map_name, map_ptr] : new_maps)
136
133
{
137
- // Transfer ownership of these new maps to their target stores, iff we
138
- // have writes to them
139
- for (const auto & [map_name, map_ptr] : new_maps)
134
+ const auto it = views.find (map_name);
135
+ if (it != views.end () && it->second ->has_writes ())
140
136
{
141
- const auto it = views.find (map_name);
142
- if (it != views.end () && it->second ->has_writes ())
143
- {
144
- map_ptr->get_store ()->add_dynamic_map (version, map_ptr);
145
- }
137
+ map_ptr->get_store ()->add_dynamic_map (version, map_ptr);
146
138
}
139
+ }
147
140
148
- for (auto it = views.begin (); it != views.end (); ++it)
149
- {
150
- it->second ->commit (
151
- version, track_read_versions, track_deletes_on_missing_keys);
152
- }
141
+ for (auto it = views.begin (); it != views.end (); ++it)
142
+ {
143
+ it->second ->commit (version, track_deletes_on_missing_keys);
144
+ }
153
145
154
- // Collect ConsensusHooks
155
- for (auto it = views.begin (); it != views.end (); ++it)
146
+ // Collect ConsensusHooks
147
+ for (auto it = views.begin (); it != views.end (); ++it)
148
+ {
149
+ auto hook_ptr = it->second ->post_commit ();
150
+ if (hook_ptr != nullptr )
156
151
{
157
- auto hook_ptr = it->second ->post_commit ();
158
- if (hook_ptr != nullptr )
159
- {
160
- hooks.push_back (std::move (hook_ptr));
161
- }
152
+ hooks.push_back (std::move (hook_ptr));
162
153
}
163
154
}
164
- else
165
- {
166
- // A linearizability violation was detected
167
- ok = false ;
168
- }
169
155
}
170
156
171
157
for (auto it = changes.begin (); it != changes.end (); ++it)
0 commit comments