You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a new unique index is added to a store and that index can be built in-line during checkVersion, it appears that this can result in the index being built and marked as readable even if there are uniqueness violations. I believe this to be caused by the way that index states are handled, as the new indexes are not marked as write-only before building them, but then there's an optimization in markIndexReadable that is intended to allow us to skip some work if someone marks an already readable index as readable:
In the case of an index during checkVersion, the index won't have a previous state, so the logic to check if there are any uniqueness violations will be skipped, which means the index will be marked as readable even though it has uniqueness violations.
The text was updated successfully, but these errors were encountered:
…ppear to be silently ignored
This validates now that when a unique index is added with duplicate entries that the build does not succeed, but also that the store opening operation isn't failed. Instead, it just means that the index is placed in an unbuilt state that will need to be resolved later (like all other uniqueness violations). This behavior means that (1) new indexes won't be built which have violations of their own invariants and (2) adding a new unique index does not put the user into a state where they might accidentally make a store impossible to open.
…silently ignored (#1373)
* Fixes#1371: Uniqueness violations during check version appear to be silently ignored
This validates now that when a unique index is added with duplicate entries that the build does not succeed, but also that the store opening operation isn't failed. Instead, it just means that the index is placed in an unbuilt state that will need to be resolved later (like all other uniqueness violations). This behavior means that (1) new indexes won't be built which have violations of their own invariants and (2) adding a new unique index does not put the user into a state where they might accidentally make a store impossible to open.
This adds a new package-private class, `IndexUniquenessCommitCheck`, which the `FDBRecordStore` will create when asked to add a new check. It associates the check with the given index so that the pertinent checks for each index can be collected and waited on when needed.
If a new unique index is added to a store and that index can be built in-line during
checkVersion
, it appears that this can result in the index being built and marked as readable even if there are uniqueness violations. I believe this to be caused by the way that index states are handled, as the new indexes are not marked as write-only before building them, but then there's an optimization inmarkIndexReadable
that is intended to allow us to skip some work if someone marks an already readable index as readable:fdb-record-layer/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/FDBRecordStore.java
Lines 2733 to 2764 in 2cd915c
In the case of an index during checkVersion, the index won't have a previous state, so the logic to check if there are any uniqueness violations will be skipped, which means the index will be marked as readable even though it has uniqueness violations.
The text was updated successfully, but these errors were encountered: