Ignore:
Timestamp:
02/27/14 17:48:47 (8 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
ab09ddc
Parents:
1fa43f8
Message:

Improve the logic behind replication, don't prune snaps which havn't been sent over
the wire yet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/lpreserver/backend/runsnap.sh

    r042dc70 r37adeaf  
    6666  # Get the last replicated snapshot 
    6767  lastSEND=`zfs get -r backup:lpreserver ${LDATA} | grep LATEST | awk '{$1=$1}1' OFS=" " | tail -1 | cut -d '@' -f 2 | cut -d ' ' -f 1` 
     68  if [ -n "$lastSend" ] ; then 
     69     sec="`echo $lastSend | cut -d '-' -f 7`" 
     70     min="`echo $lastSend | cut -d '-' -f 6`" 
     71     hour="`echo $lastSend | cut -d '-' -f 5`" 
     72     day="`echo $lastSend | cut -d '-' -f 4`" 
     73     mon="`echo $lastSend | cut -d '-' -f 3`" 
     74     year="`echo $lastSend | cut -d '-' -f 2`" 
     75     sendEpoc=`date -j -f "%Y %m %d %H %M %S" "$year $mon $day $hour $min $sec" "+%s"` 
     76  fi 
    6877 
    6978  num=0 
     
    8695     # Convert this snap to epoc time 
    8796     snapEpoc=`date -j -f "%Y %m %d %H %M %S" "$year $mon $day $hour $min $sec" "+%s"` 
     97 
     98     # If we are replicating, don't prune anything which hasn't gone out yet 
     99     if [ -n "$sendEpoc" ] ; then 
     100        if [ $sendEpoc -gt $snapEpoc ] ; then continue; fi 
     101     fi 
    88102 
    89103     # Get the epoch time elapsed 
Note: See TracChangeset for help on using the changeset viewer.