Skip to content

Commit

Permalink
Disable versioning (concurrent writes) if more than one unique key
Browse files Browse the repository at this point in the history
The reason for this is that if we change one unique key and then get a failure on the second, we may not be able to rename the first one back before someone else writes the same key value.  In Maria 2.0, when we keep deleted key values in the tree, this will not be a problem anymore
Fixed typedisable concurrent insert/select for SQLCOM_LOAD as there are problems with concurrent threads during index recreation

KNOWN_BUGS.txt:
  More comments
storage/maria/ha_maria.cc:
  Fixed typo (REPLACE -> INSERT)
  Also disable concurrent insert/select for SQLCOM_LOAD as there are problems with concurrent threads during index recreation
storage/maria/ma_open.c:
  Disable versioning (concurrent writes) if more than one unique key
  • Loading branch information
Michael Widenius committed Jun 28, 2008
1 parent c580583 commit f27efe6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
15 changes: 13 additions & 2 deletions KNOWN_BUGS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Known bugs that we are working on and will be fixed shortly
the log handler doesn't start up after restart.
Most of this should now be fixed...

- INSERT on a duplicate key against a key inserted by another connection
that has not yet ended will give a duplicate key error instead of
waiting for the other statement to end.


Known bugs that are planned to be fixed before Gamma/RC
=======================================================

Expand Down Expand Up @@ -56,14 +61,20 @@ this on a table:
wrong results if someone else is doing writes on the table during repair
or someone is doing selects during the repair index phase.

INSERT ... SELECT and REPLACE ... SELECT are blocking inserts and
SELECT for the table.
INSERT ... SELECT, REPLACE ... SELECT and LOAD DATA are blocking
inserts and SELECT for the table. They should only have to do this if
the destination is empty (as then we are using fast index rebuild).

Missing features that is planned to fix before Beta
===================================================

None

Features planned for future releases
====================================

Most notable is full transaction support and multiple reader/writers
in Maria 2.0

http://forge.mysql.com/worklog/
(you can enter "maria" in the "quick search" field there).
5 changes: 3 additions & 2 deletions storage/maria/ha_maria.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2474,8 +2474,9 @@ THR_LOCK_DATA **ha_maria::store_lock(THD *thd,
mysql_bin_log.is_open())
lock_type= TL_READ_NO_INSERT;
else if (lock_type == TL_WRITE_CONCURRENT_INSERT &&
(thd->lex->sql_command == SQLCOM_REPLACE_SELECT ||
thd->lex->sql_command == SQLCOM_REPLACE_SELECT))
(thd->lex->sql_command == SQLCOM_INSERT_SELECT ||
thd->lex->sql_command == SQLCOM_REPLACE_SELECT ||
thd->lex->sql_command == SQLCOM_LOAD))
lock_type= TL_WRITE;
file->lock.type= lock_type;
}
Expand Down
14 changes: 12 additions & 2 deletions storage/maria/ma_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,15 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
pos->null_bit=0;
pos->flag=0; /* For purify */
pos++;

if ((share->keyinfo[i].flag & HA_NOSAME) && i != 0)
{
/*
We can't yet have versioning if there is more than one unique
key
*/
versioning= 0;
}
}
for (i=0 ; i < uniques ; i++)
{
Expand Down Expand Up @@ -1345,11 +1354,12 @@ static uchar *_ma_state_info_read(uchar *ptr, MARIA_STATE_INFO *state)
@param state state which will be filled
*/

uint _ma_state_info_read_dsk(File file, MARIA_STATE_INFO *state)
uint _ma_state_info_read_dsk(File file __attribute__((unused)),
MARIA_STATE_INFO *state __attribute__((unused)))
{
#ifdef EXTERNAL_LOCKING
uchar buff[MARIA_STATE_INFO_SIZE + MARIA_STATE_EXTRA_SIZE];

#ifdef EXTERNAL_LOCKING
/* trick to detect transactional tables */
DBUG_ASSERT(state->create_rename_lsn == LSN_IMPOSSIBLE);
if (!maria_single_user)
Expand Down

0 comments on commit f27efe6

Please sign in to comment.