ee/lib/gitlab/database/load_balancing/host.rb
# Returns true if this host has caught up to the given transaction
# write location.
#
# location - The transaction write location as reported by a primary.
Returns true if this host has caught up to the given transaction
write location.

The transaction write location as reported by a primary.
Returns true if this host has caught up to the given transaction write location . The transaction write location as reported by a primary .
def caught_up?(location)
          string = connection.quote(location)
          query = <<-SQL.squish
            SELECT NOT pg_is_in_recovery()
              OR #{Gitlab::Database.pg_wal_lsn_diff}(#{Gitlab::Database.pg_last_wal_replay_lsn}(), #{string}) >= 0
              AS result
          SQL
          row = query_and_release(query)
          row['result'] == 't'
        rescue *CONNECTION_ERRORS
          false
        end
def caught_up? ( location ) string = connection . quote ( location ) query = <<-SQL . squish 
            SELECT NOT pg_is_in_recovery()
              OR  #{ Gitlab :: Database . pg_wal_lsn_diff } ( #{ Gitlab :: Database . pg_last_wal_replay_lsn } (),  #{ string } ) >= 0
              AS result
           SQL row = query_and_release ( query ) row [ 'result' ] == 't' rescue * CONNECTION_ERRORS false end
Returns true if this host has caught up to the given transaction
write location.
Returns true if this host has caught up to the given transaction write location .
# In case the host is a primary pg_last_wal_replay_lsn/pg_last_xlog_replay_location() returns # NULL. The recovery check ensures we treat the host as up-to-date in # such a case.
location
<not_specific>