[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-internals
Subject:    bk commit into 3.23 tree
From:       monty () mysql ! com
Date:       2001-11-28 13:18:31
[Download RAW message or body]

Below is the list of changes that have just been commited into a local
3.23. repository of monty. When monty does a push, they will be
propogaged to the main repository and within 24 hours after the push into
the public repository. For information on how to access
the public repository see
http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet@1.926, 2001-11-28 15:18:29+02:00, monty@hundin.mysql.fi
  Added read log caching and fixed a possible bug in write cacheing.
  This should cause fewer seeks when using replication.

  mysys/mf_iocache2.c
    1.9 01/11/28 15:18:29 monty@hundin.mysql.fi +21 -6
    Added read log caching and fixed a possible bug in write cacheing.
    This should cause fewer seeks when using replication.

  Docs/manual.texi
    1.742 01/11/28 15:18:28 monty@hundin.mysql.fi +4 -0
    Changelog

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	monty
# Host:	hundin.mysql.fi
# Root:	/my/bk/mysql

--- 1.741/Docs/manual.texi	Wed Nov 28 02:24:21 2001
+++ 1.742/Docs/manual.texi	Wed Nov 28 15:18:28 2001
@@ -46851,6 +46851,10 @@
 Fixed race condition when using the binary log and @code{INSERT DELAYED}
 which could cause the binary log to have rows that was not yet written
 to MyISAM tables.
+@item
+Changed caching of binary log to make replication slightly faster.
+@item
+Fixed bug in replication on Mac OS X.
 @end itemize
 
 @node News-3.23.45, News-3.23.44, News-3.23.46, News-3.23.x

--- 1.8/mysys/mf_iocache2.c	Wed Nov 28 02:24:22 2001
+++ 1.9/mysys/mf_iocache2.c	Wed Nov 28 15:18:29 2001
@@ -32,20 +32,35 @@
 
 void my_b_seek(IO_CACHE *info,my_off_t pos)
 {
+  my_off_t offset = (pos - info->pos_in_file);
+  DBUG_ENTER("my_b_seek");
+  DBUG_PRINT("enter",("pos: %lu", (ulong) pos));
+
   if (info->type == READ_CACHE)
   {
-    info->rc_pos=info->rc_end=info->buffer;
+    if ((ulonglong) offset < (ulonglong) (info->rc_end - info->buffer))
+    {
+      /* The read is in the current buffer; Reuse it */
+      info->rc_pos = info->buffer + offset;
+      DBUG_VOID_RETURN;
+    }
+    else
+    {
+      /* Force a new read on next my_b_read */
+      info->rc_pos=info->rc_end=info->buffer;
+    }
   }
   else if (info->type == WRITE_CACHE)
   {
-    byte* try_rc_pos;
-    try_rc_pos = info->rc_pos + (pos - info->pos_in_file);
-    if (try_rc_pos >= info->buffer && try_rc_pos <= info->rc_end)
+    /* If write is in current buffer, reuse it */
+    if ((ulonglong) offset <
+	(ulonglong) (info->rc_end - info->buffer))
     {
-      info->rc_pos = try_rc_pos;
-      return;
+      info->rc_pos = info->buffer + offset;
+      DBUG_VOID_RETURN;
     }
     flush_io_cache(info);
+    info->rc_end=(info->buffer+info->buffer_length-(pos & (IO_SIZE-1)));
   }
   info->pos_in_file=pos;
   info->seek_not_done=1;

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail internals-thread2369@lists.mysql.com
To unsubscribe, e-mail <internals-unsubscribe@lists.mysql.com>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic