title: pg_rewind failing to sync second database
body: <p>I have a PostgreSQL cluster with following databases with user <code>myuser</code>:</p>
  
  <ol>
  <li>database1</li>
  <li>database2</li>
  </ol>
  
  <p>I have set up a replication with one master (192.168.50.8) and one slave (192.168.50.9). I failover to the slave, and when I try to failback to the original master using <code>pg_rewind</code> for every database, <code>pg_rewind</code> succeeds for the first database but fails for the second database.</p>
  
  <p>For database1, running the following command on(192.168.50.8) works:</p>
  
  <pre><code>/usr/pgsql-11/bin/pg_rewind -D "data_dir_path_here" --source-server="port=pg_port_here user=myuser dbname=database1 host=192.168.50.9"
  </code></pre>
  
  <p>For database2, running the following command on (192.168.50.8) gives me an error:</p>
  
  <pre><code>/usr/pgsql-11/bin/pg_rewind -D "data_dir_path_here" --source-server="port=pg_port_here user=myuser dbname=database2 host=192.168.50.9"
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>target server must be shut down cleanly
  failure, exiting
  </code></pre>