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
ba10d4c7
Commit
ba10d4c7
authored
Apr 21, 2006
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb -
fix memory corruption in event-api maybe bug fix for 18621, 19154, 19172, 19174
parent
6be87a41
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
12 deletions
+29
-12
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+23
-11
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
+6
-1
No files found.
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
View file @
ba10d4c7
...
...
@@ -46,7 +46,7 @@
#include <EventLogger.hpp>
extern
EventLogger
g_eventLogger
;
static
Gci_container
g_empty_gci_container
;
static
Gci_container
_pod
g_empty_gci_container
;
static
const
Uint32
ACTIVE_GCI_DIRECTORY_SIZE
=
4
;
static
const
Uint32
ACTIVE_GCI_MASK
=
ACTIVE_GCI_DIRECTORY_SIZE
-
1
;
...
...
@@ -1223,12 +1223,22 @@ operator<<(NdbOut& out, const Gci_container& gci)
return
out
;
}
static
NdbOut
&
operator
<<
(
NdbOut
&
out
,
const
Gci_container_pod
&
gci
)
{
Gci_container
*
ptr
=
(
Gci_container
*
)
&
gci
;
out
<<
*
ptr
;
return
out
;
}
static
Gci_container
*
find_bucket_chained
(
Vector
<
Gci_container
>
*
active
,
Uint64
gci
)
find_bucket_chained
(
Vector
<
Gci_container
_pod
>
*
active
,
Uint64
gci
)
{
Uint32
pos
=
(
gci
&
ACTIVE_GCI_MASK
);
Gci_container
*
bucket
=
active
->
getBase
(
)
+
pos
;
Gci_container
*
bucket
=
((
Gci_container
*
)
active
->
getBase
()
)
+
pos
;
if
(
gci
>
bucket
->
m_gci
)
{
...
...
@@ -1237,8 +1247,9 @@ find_bucket_chained(Vector<Gci_container> * active, Uint64 gci)
do
{
active
->
fill
(
move_pos
,
g_empty_gci_container
);
bucket
=
active
->
getBase
()
+
pos
;
// Needs to recomputed after fill
move
=
active
->
getBase
()
+
move_pos
;
// Needs to recomputed after fill
bucket
=
((
Gci_container
*
)
active
->
getBase
())
+
pos
;
move
=
((
Gci_container
*
)
active
->
getBase
())
+
move_pos
;
if
(
move
->
m_gcp_complete_rep_count
==
0
)
{
memcpy
(
move
,
bucket
,
sizeof
(
Gci_container
));
...
...
@@ -1269,10 +1280,10 @@ find_bucket_chained(Vector<Gci_container> * active, Uint64 gci)
inline
Gci_container
*
find_bucket
(
Vector
<
Gci_container
>
*
active
,
Uint64
gci
)
find_bucket
(
Vector
<
Gci_container
_pod
>
*
active
,
Uint64
gci
)
{
Uint32
pos
=
(
gci
&
ACTIVE_GCI_MASK
);
Gci_container
*
bucket
=
active
->
getBase
(
)
+
pos
;
Gci_container
*
bucket
=
((
Gci_container
*
)
active
->
getBase
()
)
+
pos
;
if
(
likely
(
gci
==
bucket
->
m_gci
))
return
bucket
;
...
...
@@ -1370,7 +1381,8 @@ NdbEventBuffer::execSUB_GCP_COMPLETE_REP(const SubGcpCompleteRep * const rep)
{
/** out of order something */
ndbout_c
(
"out of order bucket: %d gci: %lld m_latestGCI: %lld"
,
bucket
-
m_active_gci
.
getBase
(),
gci
,
m_latestGCI
);
bucket
-
(
Gci_container
*
)
m_active_gci
.
getBase
(),
gci
,
m_latestGCI
);
bucket
->
m_state
=
Gci_container
::
GC_COMPLETE
;
bucket
->
m_gcp_complete_rep_count
=
1
;
// Prevent from being reused
m_latest_complete_GCI
=
gci
;
...
...
@@ -1387,7 +1399,7 @@ NdbEventBuffer::complete_outof_order_gcis()
Uint64
stop_gci
=
m_latest_complete_GCI
;
const
Uint32
size
=
m_active_gci
.
size
();
Gci_container
*
array
=
m_active_gci
.
getBase
();
Gci_container
*
array
=
(
Gci_container
*
)
m_active_gci
.
getBase
();
ndbout_c
(
"complete_outof_order_gcis"
);
for
(
Uint32
i
=
0
;
i
<
size
;
i
++
)
...
...
@@ -1490,7 +1502,7 @@ NdbEventBuffer::completeClusterFailed()
Uint32
sz
=
m_active_gci
.
size
();
Uint64
gci
=
~
0
;
Gci_container
*
bucket
=
0
;
Gci_container
*
array
=
m_active_gci
.
getBase
();
Gci_container
*
array
=
(
Gci_container
*
)
m_active_gci
.
getBase
();
for
(
Uint32
i
=
0
;
i
<
sz
;
i
++
)
{
if
(
array
[
i
].
m_gcp_complete_rep_count
&&
array
[
i
].
m_gci
<
gci
)
...
...
@@ -2538,5 +2550,5 @@ EventBufData_hash::search(Pos& hpos, NdbEventOperationImpl* op, LinearSectionPtr
DBUG_VOID_RETURN_EVENT
;
}
template
class
Vector
<
Gci_container
>;
template
class
Vector
<
Gci_container
_pod
>;
template
class
Vector
<
NdbEventBuffer
::
EventBufData_chunk
*
>;
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
View file @
ba10d4c7
...
...
@@ -272,6 +272,11 @@ struct Gci_container
EventBufData_hash
m_data_hash
;
};
struct
Gci_container_pod
{
char
data
[
sizeof
(
Gci_container
)];
};
class
NdbEventOperationImpl
:
public
NdbEventOperation
{
public:
NdbEventOperationImpl
(
NdbEventOperation
&
f
,
...
...
@@ -365,7 +370,7 @@ public:
~
NdbEventBuffer
();
const
Uint32
&
m_system_nodes
;
Vector
<
Gci_container
>
m_active_gci
;
Vector
<
Gci_container
_pod
>
m_active_gci
;
NdbEventOperation
*
createEventOperation
(
const
char
*
eventName
,
NdbError
&
);
NdbEventOperationImpl
*
createEventOperation
(
NdbEventImpl
&
evnt
,
...
...
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