tephra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TEPHRA-215) Share PruneUpperBoundWriter across all TransactionProcessors on the same region server
Date Wed, 08 Feb 2017 11:51:42 GMT

    [ https://issues.apache.org/jira/browse/TEPHRA-215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15857875#comment-15857875
] 

ASF GitHub Bot commented on TEPHRA-215:
---------------------------------------

Github user poornachandra commented on a diff in the pull request:

    https://github.com/apache/incubator-tephra/pull/32#discussion_r100040861
  
    --- Diff: tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/txprune/PruneUpperBoundWriter.java
---
    @@ -76,18 +76,21 @@ private void startFlushThread() {
         flushThread = new Thread("tephra-prune-upper-bound-writer") {
           @Override
           public void run() {
    -        while (!isInterrupted()) {
    +        while (!isInterrupted() && !stopped) {
               long now = System.currentTimeMillis();
               if (now > (lastChecked + pruneFlushInterval)) {
    -            if (shouldFlush.compareAndSet(true, false)) {
    +            if (!pruneEntries.isEmpty()) {
                   // should flush data
                   try {
    -                dataJanitorState.savePruneUpperBoundForRegion(regionName, pruneUpperBound.get());
    +                while (pruneEntries.firstEntry() != null) {
    +                  Map.Entry<ByteBuffer, Long> firstEntry = pruneEntries.firstEntry();
    +                  dataJanitorState.savePruneUpperBoundForRegion(firstEntry.getKey().array(),
firstEntry.getValue());
    +                  // We can now remove the entry only if the key and value match with
what we wrote since it is
    +                  // possible that a new pruneUpperBound for the same key has been added
    +                  pruneEntries.remove(firstEntry.getKey(), firstEntry.getValue());
    +                }
                   } catch (IOException ex) {
    -                LOG.warn("Cannot record prune upper bound for region " + regionNameAsString
+ " in the table " +
    -                           pruneStateTable.getNameWithNamespaceInclAsString() + " after
compacting region.", ex);
    -                // Retry again
    -                shouldFlush.set(true);
    +                LOG.warn("Cannot record prune upper bound for a region.", ex);
    --- End diff --
    
    It would be good to add prune state table name to the log message, so that it can help
in figuring out mis-configurations if any


> Share PruneUpperBoundWriter across all TransactionProcessors on the same region server
> --------------------------------------------------------------------------------------
>
>                 Key: TEPHRA-215
>                 URL: https://issues.apache.org/jira/browse/TEPHRA-215
>             Project: Tephra
>          Issue Type: Improvement
>    Affects Versions: 0.11.0-incubating
>            Reporter: Gokul Gunasekaran
>            Assignee: Gokul Gunasekaran
>             Fix For: 0.11.0-incubating
>
>
> Currently we start one prune upperbound writer thread per TransactionProcessor coprocessor.
Instead we should be able to share only one thread that flushes writes to the prune state
table periodically.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message