-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-28568 Fix incremental backup set shrinking #5876
HBASE-28568 Fix incremental backup set shrinking #5876
Conversation
The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink.
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a test for this?
@rmdmattingly added a test. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw one small error. Otherwise this looks good to me!
hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupDelete.java
Outdated
Show resolved
Hide resolved
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
The test failure looks relevant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks okay to me.
@@ -129,20 +128,15 @@ public int deleteBackups(String[] backupIds) throws IOException { | |||
} | |||
snapshotDone = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That snapshot logic looks problematic. Is it okay to continue using an existing snapshot? If an existing snapshot exists then we don't know what it contains and this operation should fail. Separate issue I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it could be problematic. Perhaps the backup repair takes care of this kind of situations, I'm not sure.
But this is a separate issue indeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @rmdmattingly this is one to look into.
hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupAdminImpl.java
Outdated
Show resolved
Hide resolved
// Keep only the tables that are present in other backups | ||
incrTableSet.retainAll(tableMap.keySet()); | ||
|
||
table.deleteIncrementalBackupTableSet(backupRoot); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This API on BackupSystemTable
is pretty ham-handed. Would be better if we could delete on the table entries that are being removed, rather than deleting and re-creating the row. I assume the lock taken via startBackupExclusiveOperation()
at the beginning of deleteBackups
prevents another actor from modifying that row concurrently...
Test failure looks like a failure of the backup system. It's attempting to take an incremental backup, which assumes the existence of a WAL that no longer exists. The test harness ran the unit test 3 times (once for each of our tested combinations of JDK version + hadoop version) and it failed once in three. I think the failure is not related to this patch but should be tracked as a flakey. @DieterDP-ng are you familiar with this test failure mode? Do we have this issue tracked in an existing ticket? |
|
I've encountered that failure while running tests (on the master branch) locally. I thought they always occurred for specific tests for me (because re-runs gave the same outcome), so I thought it had to do with my local setup. But just now I tried running all hbase-backup tests again so I could list the tests that fail for me, but now I only had a single failure for I don't know if there's an existing ticket for them, and haven't done any investigation for it. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@DieterDP-ng I filed this as https://issues.apache.org/jira/browse/HBASE-28602 |
…5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
…5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
…5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
…5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
…5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
…ly shrink (apache#5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
…ly shrink (apache#5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
@@ -30,6 +31,7 @@ | |||
import org.apache.hadoop.hbase.testclassification.LargeTests; | |||
import org.apache.hadoop.hbase.util.EnvironmentEdge; | |||
import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; | |||
import org.apache.hadoop.thirdparty.com.google.common.collect.Sets; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be using org.apache.hbase.thirdparty.com.google.common.collect.Sets
, not the hadoop one. Backports to branch-2 fail because hadoop didn't have shaded jars in Hadoop 2.x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
…5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
…5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
…5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
…ly shrink (apache#5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
…ly shrink (apache#5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]>
…ly shrink (apache#5876) (#96) * HubSpot Backport: HBASE-28568 Incremental backup set does not correctly shrink (apache#5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]> * HubSpot Backport: HBASE-28568 Incremental backup set does not correctly shrink (addendum) (apache#5917) Import the correct shaded Guava and run spotless:apply. Signed-off-by: Duo Zhang <[email protected]> --------- Signed-off-by: Nick Dimiduk <[email protected]> Signed-off-by: Duo Zhang <[email protected]> Co-authored-by: DieterDP <[email protected]>
…ly shrink (apache#5876) (#97) * HubSpot Backport: HBASE-28568 Incremental backup set does not correctly shrink (apache#5876) The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir). The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink. Reviewed-by: Ray Mattingly <[email protected]> Signed-off-by: Nick Dimiduk <[email protected]> * HubSpot Backport: HBASE-28568 Incremental backup set does not correctly shrink (addendum) (apache#5917) Import the correct shaded Guava and run spotless:apply. Signed-off-by: Duo Zhang <[email protected]> --------- Signed-off-by: Nick Dimiduk <[email protected]> Signed-off-by: Duo Zhang <[email protected]> Co-authored-by: DieterDP <[email protected]>
The incremental backup set is the set of tables included when an incremental backup is created, it is managed per backup root dir and contains all tables that are present in at least one backup (in that root dir).
The incremental backup set can only shrink when backups are deleted. However, the implementation was incorrect, causing this set to never be able to shrink.