-
Notifications
You must be signed in to change notification settings - Fork 903
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
make ledger metadata immutable #281
Comments
@ivankelly @jiazhai I marked this for 4.7.0 now. there have been discussions and concerns around the mutability of ledger metadata. let's pick this up in 4.7.0. |
I don't think we are able to do this in any time soon. dropping the release version at this moment. |
ya, not a hope for 4.7.0. This needs yahoo and saleforce merge to be 100% complete. We're close, but better to postpone til 4.8.0. I remember when I did it last time, the change only took about a day. |
@reddycharan @jvrao Are salesforce planning to make any changes to the client metadata handling? |
First part of changes to make ledger metadata immutable. The client should only act on metadata which has been written to zookeeper. To this end, we need to be able to get back from the ledger manager what has been written to zookeeper (with the version number updated). Master issue: apache#281
First part of changes to make ledger metadata immutable. The client should only act on metadata which has been written to zookeeper. To this end, we need to be able to get back from the ledger manager what has been written to zookeeper (with the version number updated). Master issue: #281 Author: Ivan Kelly <ivan@ivankelly.net> Reviewers: Enrico Olivelli <eolivelli@gmail.com> This closes #1573 from ivankelly/ledger-manager-returns-ledgermeta
This object has been accessed and mutated all over the client, which makes it hard to do anything with the object. This patch removes the direct accesses, so the object can only be accessed through an accessor. Master issue: apache#281
This object has been accessed and mutated all over the client, which makes it hard to do anything with the object. This patch removes the direct accesses, so the object can only be accessed through an accessor. Master issue: #281 Author: Ivan Kelly <ivan@ivankelly.net> Reviewers: Enrico Olivelli <eolivelli@gmail.com> This closes #1574 from ivankelly/onlyaccessmdthroughaccessor
Previously, the ensemble list was a Map<Long, ArrayList<BookieSocketAddress>>. ArrayList is by definition mutable, so ensemble passed to metadata users are always mutable. This patch changes in ensembles in the list to be immutable. We were also leaking the implementation of ledger metadata to the placement policy, so this has been modified to use List<BookieSocketAddress> also. Master issue: apache#281
Previously, the ensemble list was a Map<Long, ArrayList<BookieSocketAddress>>. ArrayList is by definition mutable, so ensemble passed to metadata users are always mutable. This patch changes in ensembles in the list to be immutable. We were also leaking the implementation of ledger metadata to the placement policy, so this has been modified to use List<BookieSocketAddress> also. Master issue: #281 Author: Ivan Kelly <ivan@ivankelly.net> Reviewers: Enrico Olivelli <eolivelli@gmail.com>, Sijie Guo <sijie@apache.org> This closes #1575 from ivankelly/ledger-fragment-immutable-metadata and squashes the following commits: 14977a2 [Ivan Kelly] fix dlog bdaef31 [Ivan Kelly] checkstyle 6e34311 [Ivan Kelly] Make each ensemble in ensemble list immutable
This patch introduces a metadata update mechanism for the client which will be used in all places where metadata is updated. The mechanism takes a bunch of predicates and functions, and runs a loop again the ledger manager, attempting to apply the mutation required as specified. It assumes that the ledger metadata objects on the client side are immutable and that any metadata object read reflects state that exists on the metadata store. This isn't the case right now, but as the current metadata updates are changed to use this, it will be the case. This patch also introduces a limited LedgerMetadataBuilder, though only the fields required for testing at mutable. Master Issue: apache#281
LedgerMetadata shouldn't generally be created outside the client, except for testing. In the case where it is, the builder should be used to construct it. I've left the copy constructor for now, as I don't feel comfortable removing it until all fields are final, which will occur soon. Master issue: apache#281
Make most fields in LedgerMetadata final. The ones which I have not changed in this patch require a more involved change, so they'll come in separate PRs. Master issue: apache#281
LedgerMetadata shouldn't generally be created outside the client, except for testing. In the case where it is, the builder should be used to construct it. I've left the copy constructor for now, as I don't feel comfortable removing it until all fields are final, which will occur soon. Master issue: #281 Reviewers: Enrico Olivelli <eolivelli@gmail.com> This closes #1827 from ivankelly/kill-constructors
Make most fields in LedgerMetadata final. The ones which I have not changed in this patch require a more involved change, so they'll come in separate PRs. Master issue: apache#281
The method is only used in the test, so it should live there. Master issue: apache#281
Remove any methods in LedgerMetadata that modify the ensemble. With this change the ensembles are 100% immutable. Master issue: apache#281
A copy constructor makes no sense when it's not possible to mutate the object. Master issue: apache#281
Master issue: apache#281
The two parameters are long, which can be confusing. Master issue: apache#281
There's never a case when setting the digest and password where you only have one, but not the other. The builder should reflect this. Master issue: apache#281
* Rename LedgerMetadataBuilder#closingAt to clarify parameter order The two parameters are long, which can be confusing. Master issue: #281
The metadata is immutable now. See the long list of changes for details. |
There's never a case when setting the digest and password where you only have one, but not the other. The patch adds validation in LedgerMetadata that if you provide one, you provide the other. The only case where you don't provide these is when using pre-4.1.0 (i think) metadata. Master issue: #281 Reviewers: Sijie Guo <sijie@apache.org>, Enrico Olivelli <eolivelli@gmail.com> This closes #1836 from ivankelly/builder-pw
FEATURE REQUEST
Address the TODO item in LedgerHandle
nice-to-have
The text was updated successfully, but these errors were encountered: