replicator/lib/ruby/pg-wal-plugin.rb
# Ties current replication position to the current time, so slave latency
# could be calculated later.
Ties current replication position to the current time, so slave latency
could be calculated later.
Ties current replication position to the current time so slave latency could be calculated later .
def save_progress_timestamp
    if tag_file_exist?(@online)
      exec_cmd2("psql -p#{@config.getProperty("postgresql.port")} -t -c \"DELETE FROM progress_timestamp\" #{@tungsten_db};", true, true)
      exec_cmd2("psql -p#{@config.getProperty("postgresql.port")} -t -c \"INSERT INTO progress_timestamp VALUES (pg_xlogfile_name(pg_current_xlog_location()), pg_current_xlog_location(), CURRENT_TIMESTAMP)\" #{@tungsten_db};", true, true)
    end
  end
def save_progress_timestamp if tag_file_exist? ( @online ) exec_cmd2 ( "psql -p#{@config.getProperty("postgresql.port")} -t -c \"DELETE FROM progress_timestamp\" #{@tungsten_db};" , true , true ) exec_cmd2 ( "psql -p#{@config.getProperty("postgresql.port")} -t -c \"INSERT INTO progress_timestamp VALUES (pg_xlogfile_name(pg_current_xlog_location()), pg_current_xlog_location(), CURRENT_TIMESTAMP)\" #{@tungsten_db};" , true , true ) end end
Ties current replication position to the current time, so slave latency
could be calculated later.
Ties current replication position to the current time so slave latency could be calculated later .
# Make sure we are online.  # We don't need old records. # Link current WAL file and SR offset to current time.