Skip to content

Commit

Permalink
uses the executed position ... that is based on the relay log,
Browse files Browse the repository at this point in the history
if no wrapper using_master? returns false as selects go to the slaves
  • Loading branch information
tcurdt committed May 30, 2011
1 parent a5bddda commit dd93ad2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/master_slave_adapter/adapter.rb
Expand Up @@ -165,7 +165,8 @@ def using_master?
if Thread.current[:master_slave_select_connection]
Thread.current[:master_slave_select_connection][0] == :master
else
nil
# there is no wrapper so selects go to slave by default
false
end
end

Expand Down Expand Up @@ -237,7 +238,7 @@ def master_clock

def slave_clock
if status = connect_to_slave.select_one("SHOW SLAVE STATUS")
Clock.new(status['Master_Log_File'], status['Exec_Master_Log_Pos'])
Clock.new(status['Relay_Master_Log_File'], status['Exec_Master_Log_Pos'])
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/master_slave_adapter/version.rb
@@ -1,3 +1,3 @@
module MasterSlaveAdapter
VERSION = "0.0.1"
VERSION = "0.0.2"
end

0 comments on commit dd93ad2

Please sign in to comment.