[tiered storage] store driver name and driver specific metadata in original ledger metadata #2398
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Currently the location of an offloaded ledger isn't stored in the original ledger metadata.
That means if configuration is changed or modified by mistake. We might potentially cause data loss.
The location of an offloaded ledger is needed by Pulsar SQL. so it is very inconvinient to
have the location information stored in a configuration and the approach is also problematic.
Changes
Store
driverName
and driver-specific metadata (e.g. bucket name, region name, endpoint) in theoriginal ledger metadata. Change ManagedLedgerImpl to use the driver-specific metadata to read
the offloaded ledger. If the driver-specific metadata is missed, it will fall back to use the configuration.
Tests
This change doesn't change the behavior. Existing unit tests and integration tests already covered the logic.
NOTES
Currently the driver name in metadata is not used. We need to use driver name to load different offloader driver
after #2393 is implemented