[ 
https://issues.apache.org/jira/browse/HBASE-28456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17830215#comment-17830215
 ] 

Ruben Van Wanzeele commented on HBASE-28456:
--------------------------------------------

[~bbeaudreault] 

Same issue with puts and flushes in between, changed the load method to the 
following
{code:java}
private void load(TableName tableName, Instant timestamp, String data)
  throws IOException {
  LOG.info("Writing new data to HBase: " + data);
  try (Connection connection = 
ConnectionFactory.createConnection(cluster.getConf())) {
    Table table = connection.getTable(SOURCE_TABLE_NAME);
    List<Put> puts = new ArrayList<>();
    for (int i = 0; i < 10_000; i++) {
      Put put = new Put(Bytes.toBytes(i), timestamp.toEpochMilli());
      put.add(new KeyValue(Bytes.toBytes(i), COLUMN_FAMILY, 
Bytes.toBytes("data"),
        timestamp.toEpochMilli(), Bytes.toBytes(data)));
        puts.add(put);
    }
    table.put(puts);
    connection.getAdmin().flush(tableName);
  }
} {code}

> HBase Restore restores old data if data for the same timestamp is in 
> different hfiles
> -------------------------------------------------------------------------------------
>
>                 Key: HBASE-28456
>                 URL: https://issues.apache.org/jira/browse/HBASE-28456
>             Project: HBase
>          Issue Type: Bug
>          Components: backup&amp;restore
>    Affects Versions: 2.6.0, 3.0.0
>            Reporter: Ruben Van Wanzeele
>            Priority: Critical
>         Attachments: 
> ChangesOnHFilesOnSameTimestampAreNotCorrectlyRestored.java
>
>
> The restore brings back 'old' data when executing restore.
> It feels like the hfile sequence id is not respected during the restore.
> See testing code attached. The workaround solution is to trigger major 
> compaction before doing the backup (not really feasible for daily backups)
> We didn't investigate this yet, but this might also impact the merge of 
> multiple incremental backups (since that follows a similar code path merging 
> hfiles).
> This currently blocks our support for HBase backup and restore.
> Willing to participate in a solution if necessary.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to