Ian Maxon has posted comments on this change. Change subject: [ASTERIXDB-1952][TX][IDX] Filter logs pt.2 ......................................................................
Patch Set 23: (3 comments) https://asterix-gerrit.ics.uci.edu/#/c/1857/23/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/RecoveryManager.java File asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/RecoveryManager.java: PS23, Line 232: case LogType.FILTER: > Do we have a test case for filter logging? No, not really. Not this case anyway. I plan to move all the other filter code to use this logtype eventually. So it'd use it then. https://asterix-gerrit.ics.uci.edu/#/c/1857/23/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java File asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/LSMPrimaryUpsertOperatorNodePushable.java: PS23, Line 170: lsmAccessor.updateFilter(prevTuple, true); > Just curious about this line... Say you had a secondary index with only inserts, and then flushed it, and it had filter values [n,m]. Now say you upsert one of those tuples, with filtered value [m+1,q], and then flushed it. Then the tuple is upserted again, now with filter value [n,m]. If one was to search the index with filter predicate [m+1,q] they would never see the newest upserted value. So, you have to make sure to widen the filter to [n,q] by using the previous tuple's filtered value as well. https://asterix-gerrit.ics.uci.edu/#/c/1857/23/asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/opcallbacks/AbstractIndexModificationOperationCallback.java File asterixdb/asterix-transactions/src/main/java/org/apache/asterix/transaction/management/opcallbacks/AbstractIndexModificationOperationCallback.java: PS23, Line 127: public void after(ITupleReference newValue) throws HyracksDataException { : try { : if (newValue != null) { : filterRecord.setNewValueSize(SimpleTupleWriter.INSTANCE.bytesRequired(newValue)); : filterRecord.setNewValue(newValue); : filterRecord.computeAndSetLogSize(); : txnSubsystem.getLogManager().log(filterRecord); : } : } catch (ACIDException e) { : throw new HyracksDataException(e); : } : } > So with filter, each update operation on an index will produce two log reco Yes. This could be made better by only accepting filter updates that would actually change the filter width. -- To view, visit https://asterix-gerrit.ics.uci.edu/1857 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9e7795d9c8c212e8610dcb9bb5d26ec9fbbee8a Gerrit-PatchSet: 23 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Ian Maxon <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Ian Maxon <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Luo Chen <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]> Gerrit-HasComments: Yes
