MCPcopy Create free account
hub / github.com/MariaDB/server / commit

Method commit

sql/wsrep_storage_service.cc:146–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146int Wsrep_storage_service::commit(const wsrep::ws_handle& ws_handle,
147 const wsrep::ws_meta& ws_meta)
148{
149 DBUG_ENTER("Wsrep_storage_service::commit");
150 DBUG_ASSERT(m_thd == current_thd);
151 DBUG_PRINT("info", ("Wsrep_storage_service::commit(%llu, %p)",
152 m_thd->thread_id, m_thd));
153 WSREP_DEBUG("Storage service commit: %llu, %lld",
154 ws_meta.transaction_id().get(), ws_meta.seqno().get());
155 int ret= 0;
156 const bool is_ordered= !ws_meta.seqno().is_undefined();
157
158 if (is_ordered)
159 {
160 ret= m_thd->wsrep_cs().prepare_for_ordering(ws_handle, ws_meta, true);
161 }
162
163 ret= ret || trans_commit(m_thd);
164
165 if (!is_ordered)
166 {
167 /* Wsrep commit was not ordered so it does not go through commit time
168 hooks and remains active. Roll it back to make cleanup happen
169 in after_applying() call. */
170 m_thd->wsrep_cs().before_rollback();
171 m_thd->wsrep_cs().after_rollback();
172 }
173 else if (ret)
174 {
175 /* Commit failed, this probably means that the parent SR transaction
176 was BF aborted. Roll back out of order, the parent
177 transaction will release commit order after it has rolled back. */
178 m_thd->wsrep_cs().prepare_for_ordering(wsrep::ws_handle(),
179 wsrep::ws_meta(),
180 false);
181 trans_rollback(m_thd);
182 }
183 m_thd->wsrep_cs().after_applying();
184 m_thd->release_transactional_locks();
185 DBUG_RETURN(ret);
186}
187
188int Wsrep_storage_service::rollback(const wsrep::ws_handle& ws_handle,
189 const wsrep::ws_meta& ws_meta)

Callers

nothing calls this directly

Calls 5

trans_commitFunction · 0.85
trans_rollbackFunction · 0.85
seqnoMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected