Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
6ae7fa68
Commit
6ae7fa68
authored
Feb 21, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify TrxUndoRsegs
Construct directly from trx_rseg_t&. push_back(), size(): Remove.
parent
d4187bdc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
74 deletions
+20
-74
storage/innobase/include/trx0purge.h
storage/innobase/include/trx0purge.h
+13
-53
storage/innobase/include/trx0sys.h
storage/innobase/include/trx0sys.h
+0
-1
storage/innobase/trx/trx0purge.cc
storage/innobase/trx/trx0purge.cc
+4
-10
storage/innobase/trx/trx0rseg.cc
storage/innobase/trx/trx0rseg.cc
+1
-5
storage/innobase/trx/trx0trx.cc
storage/innobase/trx/trx0trx.cc
+2
-5
No files found.
storage/innobase/include/trx0purge.h
View file @
6ae7fa68
...
...
@@ -27,14 +27,8 @@ Created 3/26/1996 Heikki Tuuri
#ifndef trx0purge_h
#define trx0purge_h
#include "univ.i"
#include "trx0types.h"
#include "mtr0mtr.h"
#include "trx0sys.h"
#include "trx0rseg.h"
#include "que0types.h"
#include "page0page.h"
#include "fil0fil.h"
#include "read0types.h"
/** A dummy undo record used as a return value when we have a whole undo log
which needs no purge */
...
...
@@ -105,14 +99,14 @@ class TrxUndoRsegs {
typedef
trx_rsegs_t
::
iterator
iterator
;
/** Default constructor */
TrxUndoRsegs
(
)
:
m_trx_no
()
{
}
TrxUndoRsegs
(
trx_id_t
trx_no
=
0
)
:
m_trx_no
(
trx_no
)
{
}
explicit
TrxUndoRsegs
(
trx_id_t
trx_no
)
:
m_trx_no
(
trx_no
)
{
// Do nothing
}
/** Constructor */
TrxUndoRsegs
(
trx_rseg_t
&
rseg
)
:
m_trx_no
(
rseg
.
last_trx_no
),
m_rsegs
(
1
,
&
rseg
)
{}
/** Constructor */
TrxUndoRsegs
(
trx_id_t
trx_no
,
trx_rseg_t
&
rseg
)
:
m_trx_no
(
trx_no
),
m_rsegs
(
1
,
&
rseg
)
{
}
/** Get transaction number
@return trx_id_t - get transaction number. */
...
...
@@ -121,40 +115,10 @@ class TrxUndoRsegs {
return
(
m_trx_no
);
}
/** Add rollback segment.
@param rseg rollback segment to add. */
void
push_back
(
trx_rseg_t
*
rseg
)
{
m_rsegs
.
push_back
(
rseg
);
}
/** Erase the element pointed by given iterator.
@param[in] iterator iterator */
void
erase
(
iterator
&
it
)
{
m_rsegs
.
erase
(
it
);
}
/** Number of registered rsegs.
@return size of rseg list. */
ulint
size
()
const
{
return
(
m_rsegs
.
size
());
}
/**
@return an iterator to the first element */
iterator
begin
()
{
return
(
m_rsegs
.
begin
());
}
/**
@return an iterator to the end */
iterator
end
()
{
return
(
m_rsegs
.
end
());
}
bool
empty
()
const
{
return
m_rsegs
.
empty
();
}
void
erase
(
iterator
&
it
)
{
m_rsegs
.
erase
(
it
);
}
iterator
begin
()
{
return
(
m_rsegs
.
begin
());
}
iterator
end
()
{
return
(
m_rsegs
.
end
());
}
/** Append rollback segments from referred instance to current
instance. */
...
...
@@ -176,10 +140,6 @@ class TrxUndoRsegs {
return
(
lhs
.
m_trx_no
>
rhs
.
m_trx_no
);
}
/** Compiler defined copy-constructor/assignment operator
should be fine given that there is no reference to a memory
object outside scope of class object.*/
private:
/** The rollback segments transaction number. */
trx_id_t
m_trx_no
;
...
...
@@ -202,7 +162,7 @@ struct TrxUndoRsegsIterator {
/** Sets the next rseg to purge in purge_sys.
@return whether anything is to be purged */
bool
set_next
();
inline
bool
set_next
();
private:
// Disable copying
...
...
storage/innobase/include/trx0sys.h
View file @
6ae7fa68
...
...
@@ -35,7 +35,6 @@ Created 3/26/1996 Heikki Tuuri
#include "mem0mem.h"
#include "mtr0mtr.h"
#include "ut0byte.h"
#include "mem0mem.h"
#include "ut0lst.h"
#include "read0types.h"
#include "page0types.h"
...
...
storage/innobase/trx/trx0purge.cc
View file @
6ae7fa68
...
...
@@ -64,7 +64,7 @@ my_bool srv_purge_view_update_only_debug;
#endif
/* UNIV_DEBUG */
/** Sentinel value */
const
TrxUndoRsegs
TrxUndoRsegsIterator
::
NullElement
(
UINT64_UNDEFINED
);
const
TrxUndoRsegs
TrxUndoRsegsIterator
::
NullElement
(
TRX_ID_MAX
);
/** Constructor */
TrxUndoRsegsIterator
::
TrxUndoRsegsIterator
()
...
...
@@ -110,7 +110,7 @@ TrxUndoRsegsIterator::set_next()
while
(
!
purge_queue
.
empty
())
{
if
(
m_trx_undo_rsegs
.
get_trx_no
()
==
UINT64_UNDEFINED
)
{
if
(
m_trx_undo_rsegs
.
get_trx_no
()
==
TRX_ID_MAX
)
{
m_trx_undo_rsegs
=
purge_queue
.
top
();
}
else
if
(
purge_queue
.
top
().
get_trx_no
()
==
m_trx_undo_rsegs
.
get_trx_no
())
{
...
...
@@ -903,10 +903,7 @@ trx_purge_cleanse_purge_queue(
}
}
if
(
it
->
size
())
{
/* size != 0 suggest that there exist other rsegs that
needs processing so add this element to purge queue.
Note: Other rseg could be non-redo rsegs. */
if
(
!
it
->
empty
())
{
purge_sys
->
purge_queue
.
push
(
*
it
);
}
}
...
...
@@ -1174,9 +1171,6 @@ trx_purge_rseg_get_next_history_log(
rseg
->
last_trx_no
=
trx_no
;
rseg
->
needs_purge
=
purge
!=
0
;
TrxUndoRsegs
elem
(
rseg
->
last_trx_no
);
elem
.
push_back
(
rseg
);
/* Purge can also produce events, however these are already ordered
in the rollback segment and any user generated event will be greater
than the events that Purge produces. ie. Purge can never produce
...
...
@@ -1184,7 +1178,7 @@ trx_purge_rseg_get_next_history_log(
mutex_enter
(
&
purge_sys
->
pq_mutex
);
purge_sys
->
purge_queue
.
push
(
elem
);
purge_sys
->
purge_queue
.
push
(
*
rseg
);
mutex_exit
(
&
purge_sys
->
pq_mutex
);
...
...
storage/innobase/trx/trx0rseg.cc
View file @
6ae7fa68
...
...
@@ -479,15 +479,11 @@ trx_rseg_mem_restore(
ut_ad
(
purge
<=
1
);
rseg
->
needs_purge
=
purge
!=
0
;
TrxUndoRsegs
elem
(
rseg
->
last_trx_no
);
elem
.
push_back
(
rseg
);
if
(
rseg
->
last_page_no
!=
FIL_NULL
)
{
/* There is no need to cover this operation by the purge
mutex because we are still bootstrapping. */
purge_sys
->
purge_queue
.
push
(
elem
);
purge_sys
->
purge_queue
.
push
(
*
rseg
);
}
}
}
...
...
storage/innobase/trx/trx0trx.cc
View file @
6ae7fa68
...
...
@@ -1224,15 +1224,12 @@ trx_serialise(trx_t* trx)
trx_sys
.
assign_new_trx_no
(
trx
);
/* If the rollack segment is not empty then the
/* If the roll
b
ack segment is not empty then the
new trx_t::no can't be less than any trx_t::no
already in the rollback segment. User threads only
produce events when a rollback segment is empty. */
if
(
rseg
->
last_page_no
==
FIL_NULL
)
{
TrxUndoRsegs
elem
(
trx
->
no
);
elem
.
push_back
(
rseg
);
purge_sys
->
purge_queue
.
push
(
elem
);
purge_sys
->
purge_queue
.
push
(
TrxUndoRsegs
(
trx
->
no
,
*
rseg
));
mutex_exit
(
&
purge_sys
->
pq_mutex
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment