[ https://issues.apache.org/jira/browse/TEPHRA-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15875250#comment-15875250 ]
ASF GitHub Bot commented on TEPHRA-223: --------------------------------------- GitHub user poornachandra opened a pull request: https://github.com/apache/incubator-tephra/pull/37 TEPHRA-223 Encapsulate the two data structures used for invalid transactions to avoid update issues JIRA - https://issues.apache.org/jira/browse/TEPHRA-223 Approach: Encapsulate the invalid list and the invalidArray data structures into a class InvalidTxList. InvalidTxList tracks the changes to invalid list, and then populates invalidArray lazily when the list changes. TODO: Add tests for class InvalidTxList You can merge this pull request into a Git repository by running: $ git pull https://github.com/poornachandra/incubator-tephra feature/invalid-persistence Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-tephra/pull/37.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #37 ---- commit 41f293e6f23a307a7709aba0c3a625abb29f9d4d Author: poorna <poo...@cask.co> Date: 2017-02-21T01:13:39Z TEPHRA-223 Encapsulate the two data structures used for invalid transactions to avoid update issues commit ff2996916307ee49c215aba9758b03ad7b318db9 Author: poorna <poo...@cask.co> Date: 2017-02-21T01:52:20Z TEPHRA-223 Synchronize the access to invalid list ---- > Transactions started after a snapshot restore can have incorrect invalid > transaction list > ----------------------------------------------------------------------------------------- > > Key: TEPHRA-223 > URL: https://issues.apache.org/jira/browse/TEPHRA-223 > Project: Tephra > Issue Type: Bug > Components: core > Affects Versions: 0.5.0, 0.6.5, 0.7.0, 0.8.0-incubating, 0.9.0-incubating, > 0.10.0-incubating > Reporter: Poorna Chandra > Assignee: Poorna Chandra > Fix For: 0.12.0-incubating > > > Transaction Manager uses two datastructures to manage the invalid list - a > {{List}} and an {{array}}. All updates to invalid list happen to the > {{List}}, and the list is then sorted and copied over to the {{array}}. This > is an optimization done so as to not sort the invalid list every time a new > transaction is created. > However during a snapshot restore after the Transaction Manager starts up, > the invalid list gets correctly restored to the {{List}} but does not get > copied over to the {{array}}. This will lead to transactions started right > after a snapshot restore to have empty invalid list. This will make invalid > data to become visible to those transactions. > Since the {{List}} still contains the right invalid list, any update to the > invalid list - like invalidating a transaction, will restore the {{array}} > back to a good state. > Also compactions will still remove invalid data as expected since new > snapshots are searialized using the {{List}} -- This message was sent by Atlassian JIRA (v6.3.15#6346)