Add alias and option to support migration
The main goal of the change is to allow us to change the name of the
blobId while making sure the existing data is still valid during the
migration. Added an alias option which allow us to have two possible
valid blobId and will use the `baseBlobId` to commit the data even if
the current data match the alish ID. This allow us to change the blobId
of the binary store without loosing the data.
Also added an option to revert back to the alias blobId with the
`blobtool` to support backward compatibility when we need to downgrade
to a version without alias support. Created the base service that gets
trigger to start the blob id revert.
Tested:
Tested backward compatibility and working fine. The blob data are not
lost between versions.
Change-Id: I75bcbce3aff20c6ee8a491bef36fac260595d6f7
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/include/binarystore_interface.hpp b/include/binarystore_interface.hpp
index ba6dca3..3760305 100644
--- a/include/binarystore_interface.hpp
+++ b/include/binarystore_interface.hpp
@@ -30,6 +30,13 @@
virtual std::string getBaseBlobId() const = 0;
/**
+ * Set the base blob id
+ * @param baseBlobId: The blob id to update to.
+ * @returns true if the binary store is updated with the new baseBlobId
+ */
+ virtual bool setBaseBlobId(const std::string& baseBlobId) = 0;
+
+ /**
* @returns List of all open blob IDs, plus the base.
*/
virtual std::vector<std::string> getBlobIds() const = 0;