[GitHub] incubator-tephra pull request #35: (TEPHRA-219) Execute cross region calls i...
Github user poornachandra commented on a diff in the pull request: https://github.com/apache/incubator-tephra/pull/35#discussion_r100709175 --- Diff: tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/txprune/PruneUpperBoundWriter.java --- @@ -81,14 +84,23 @@ private void startFlushThread() { flushThread = new Thread("tephra-prune-upper-bound-writer") { @Override public void run() { -while ((!isInterrupted()) && isRunning()) { +Service.State serviceState = state(); +while ((!isInterrupted()) && + (serviceState.equals(Service.State.NEW) || serviceState.equals(Service.State.STARTING) || --- End diff -- hmm - do you think it would simplify the code if we go back to using a `stop` flag? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[GitHub] incubator-tephra pull request #35: (TEPHRA-219) Execute cross region calls i...
Github user poornachandra commented on a diff in the pull request: https://github.com/apache/incubator-tephra/pull/35#discussion_r100709097 --- Diff: tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java --- @@ -317,31 +317,31 @@ public InternalScanner preCompactScannerOpen(ObserverContext
[jira] [Commented] (TEPHRA-219) Setup proper security context in co-processor for compaction and flushes
[ https://issues.apache.org/jira/browse/TEPHRA-219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15863074#comment-15863074 ] ASF GitHub Bot commented on TEPHRA-219: --- Github user poornachandra commented on a diff in the pull request: https://github.com/apache/incubator-tephra/pull/35#discussion_r100709949 --- Diff: tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/txprune/PruneUpperBoundWriter.java --- @@ -81,14 +84,23 @@ private void startFlushThread() { flushThread = new Thread("tephra-prune-upper-bound-writer") { @Override public void run() { -while ((!isInterrupted()) && isRunning()) { +Service.State serviceState = state(); +while ((!isInterrupted()) && + (serviceState.equals(Service.State.NEW) || serviceState.equals(Service.State.STARTING) || +serviceState.equals(Service.State.RUNNING))) { long now = System.currentTimeMillis(); if (now > (lastChecked + pruneFlushInterval)) { // should flush data try { while (pruneEntries.firstEntry() != null) { -Map.EntryfirstEntry = pruneEntries.firstEntry(); - dataJanitorState.savePruneUpperBoundForRegion(firstEntry.getKey(), firstEntry.getValue()); +final Map.Entry firstEntry = pruneEntries.firstEntry(); +User.runAsLoginUser(new PrivilegedExceptionAction() { --- End diff -- Adding `User.runAsLoginUser` here brings in unnecessary security code into `PruneUpperBoundWriter` class. Also if we modify `TransactionProcessor` later to add other table operations, we may miss to wrap those calls. I think it would be better to do the wrapping in `TransactionProcessor` class itself. What do you say? > Setup proper security context in co-processor for compaction and flushes > > > Key: TEPHRA-219 > URL: https://issues.apache.org/jira/browse/TEPHRA-219 > Project: Tephra > Issue Type: Sub-task >Reporter: Poorna Chandra >Assignee: Gokul Gunasekaran > Fix For: 0.11.0-incubating > > > From PHOENIX-3037, HBASE-16115 and HBASE-16141 - HBase runs compaction/flush > co-processor hooks as the user (current user) who started the > compaction/flush. This becomes an issue when a co-processor makes cross > region server calls in hooks. If the calls are made as the current user, then > the call may fail since the current user may not have sufficient privileges > to perform the call. > Tephra TransactionProcessor will need to run all calls in compaction/flush > hooks as the login user instead of the current user. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (TEPHRA-219) Setup proper security context in co-processor for compaction and flushes
[ https://issues.apache.org/jira/browse/TEPHRA-219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15863076#comment-15863076 ] ASF GitHub Bot commented on TEPHRA-219: --- Github user poornachandra commented on a diff in the pull request: https://github.com/apache/incubator-tephra/pull/35#discussion_r100709097 --- Diff: tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java --- @@ -317,31 +317,31 @@ public InternalScanner preCompactScannerOpen(ObserverContext Setup proper security context in co-processor for compaction and flushes > > > Key: TEPHRA-219 > URL: https://issues.apache.org/jira/browse/TEPHRA-219 > Project: Tephra > Issue Type: Sub-task >Reporter: Poorna Chandra >Assignee: Gokul Gunasekaran > Fix For: 0.11.0-incubating > > > From PHOENIX-3037, HBASE-16115 and HBASE-16141 - HBase runs compaction/flush > co-processor hooks as the user (current user) who started the > compaction/flush. This becomes an issue when a co-processor makes cross > region server calls in hooks. If the calls are made as the current user, then > the call may fail since the current user may not have sufficient privileges > to perform the call. > Tephra TransactionProcessor will need to run all calls in compaction/flush > hooks as the login user instead of the current user. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[GitHub] incubator-tephra pull request #35: (TEPHRA-219) Execute cross region calls i...
Github user poornachandra commented on a diff in the pull request: https://github.com/apache/incubator-tephra/pull/35#discussion_r100709949 --- Diff: tephra-hbase-compat-1.1-base/src/main/java/org/apache/tephra/hbase/txprune/PruneUpperBoundWriter.java --- @@ -81,14 +84,23 @@ private void startFlushThread() { flushThread = new Thread("tephra-prune-upper-bound-writer") { @Override public void run() { -while ((!isInterrupted()) && isRunning()) { +Service.State serviceState = state(); +while ((!isInterrupted()) && + (serviceState.equals(Service.State.NEW) || serviceState.equals(Service.State.STARTING) || +serviceState.equals(Service.State.RUNNING))) { long now = System.currentTimeMillis(); if (now > (lastChecked + pruneFlushInterval)) { // should flush data try { while (pruneEntries.firstEntry() != null) { -Map.EntryfirstEntry = pruneEntries.firstEntry(); - dataJanitorState.savePruneUpperBoundForRegion(firstEntry.getKey(), firstEntry.getValue()); +final Map.Entry firstEntry = pruneEntries.firstEntry(); +User.runAsLoginUser(new PrivilegedExceptionAction() { --- End diff -- Adding `User.runAsLoginUser` here brings in unnecessary security code into `PruneUpperBoundWriter` class. Also if we modify `TransactionProcessor` later to add other table operations, we may miss to wrap those calls. I think it would be better to do the wrapping in `TransactionProcessor` class itself. What do you say? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[jira] [Commented] (TEPHRA-216) Invalid Transaction List Pruning will not proceed if there are empty transactional tables
[ https://issues.apache.org/jira/browse/TEPHRA-216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15862702#comment-15862702 ] ASF GitHub Bot commented on TEPHRA-216: --- Github user poornachandra commented on the issue: https://github.com/apache/incubator-tephra/pull/34 @gokulavasan I have ported the changes to other compat modules, please take a look. > Invalid Transaction List Pruning will not proceed if there are empty > transactional tables > - > > Key: TEPHRA-216 > URL: https://issues.apache.org/jira/browse/TEPHRA-216 > Project: Tephra > Issue Type: Sub-task >Affects Versions: 0.11.0-incubating >Reporter: Gokul Gunasekaran >Assignee: Poorna Chandra > > Since empty table/regions might not undergo major compaction, the prune upper > bound of these regions will never have a value and thus will limit the > progress of invalid list transaction pruning. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[GitHub] incubator-tephra issue #34: TEPHRA-216 Handle empty transactional regions du...
Github user poornachandra commented on the issue: https://github.com/apache/incubator-tephra/pull/34 @gokulavasan I have ported the changes to other compat modules, please take a look. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---