You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/09/01 09:38:22 UTC

[GitHub] [hive] deniskuzZ opened a new pull request #2612: added dedup for the COMPLETED_TXN_COMPONENTS

deniskuzZ opened a new pull request #2612:
URL: https://github.com/apache/hive/pull/2612


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description, screenshot and/or a reproducable example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Hive versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on a change in pull request #2612: added dedup for the COMPLETED_TXN_COMPONENTS

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on a change in pull request #2612:
URL: https://github.com/apache/hive/pull/2612#discussion_r699251921



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate

Review comment:
       COMPLETED_TXN_COMPONENTS contains only committed txns. Aborted & open stay in TXN_COMPONENTS




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ merged pull request #2612: HIVE-25503: Add cleanup for the duplicate COMPLETED_TXN_COMPONENTS entries

Posted by GitBox <gi...@apache.org>.
deniskuzZ merged pull request #2612:
URL: https://github.com/apache/hive/pull/2612


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pvary commented on pull request #2612: HIVE-25503: Add cleanup for the duplicate COMPLETED_TXN_COMPONENTS entries

Posted by GitBox <gi...@apache.org>.
pvary commented on pull request #2612:
URL: https://github.com/apache/hive/pull/2612#issuecomment-918976830


   Can we add test cases for this method?
   Can we at least manually run these tests with the supported databases - the queries look scary 😄 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pvary commented on a change in pull request #2612: added dedup for the COMPLETED_TXN_COMPONENTS

Posted by GitBox <gi...@apache.org>.
pvary commented on a change in pull request #2612:
URL: https://github.com/apache/hive/pull/2612#discussion_r699263559



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate

Review comment:
       Got it. Thanks!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pvary commented on a change in pull request #2612: added dedup for the COMPLETED_TXN_COMPONENTS

Posted by GitBox <gi...@apache.org>.
pvary commented on a change in pull request #2612:
URL: https://github.com/apache/hive/pull/2612#discussion_r699243555



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate

Review comment:
       Shouldn't we check that the corresponding transaction is not aborted, or open?

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate
+        stmt.execute("DELETE FROM \"COMPLETED_TXN_COMPONENTS\" WHERE CTC_WRITEID\" NOT IN ("+

Review comment:
       Materialized view invalidation is dependent on `CTC_UPDATE_DELETE` values, so I think we should keep different values if there are any. See `TxnHandler.getMaterializationInvalidationInfo`. Maybe @kasakrisz knows more about this.
   
   Also I think moving this query to `AcidHouseKeeperService` would be good, as this is housekeeping.

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate

Review comment:
       Got it. Thanks!

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate
+        stmt.execute("DELETE FROM \"COMPLETED_TXN_COMPONENTS\" WHERE CTC_WRITEID\" NOT IN ("+

Review comment:
       Should we just advise the user to decrease the frequency of the `AcidHouseKeeperService`? Or use a different config?
   
   IMHO it would be better than putting the code to a different place, just because of the frequency is lower there...
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pvary commented on a change in pull request #2612: added dedup for the COMPLETED_TXN_COMPONENTS

Posted by GitBox <gi...@apache.org>.
pvary commented on a change in pull request #2612:
URL: https://github.com/apache/hive/pull/2612#discussion_r699263219



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate
+        stmt.execute("DELETE FROM \"COMPLETED_TXN_COMPONENTS\" WHERE CTC_WRITEID\" NOT IN ("+

Review comment:
       Materialized view invalidation is dependent on `CTC_UPDATE_DELETE` values, so I think we should keep different values if there are any. See `TxnHandler.getMaterializationInvalidationInfo`. Maybe @kasakrisz knows more about this.
   
   Also I think moving this query to `AcidHouseKeeperService` would be good, as this is housekeeping.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pvary commented on a change in pull request #2612: added dedup for the COMPLETED_TXN_COMPONENTS

Posted by GitBox <gi...@apache.org>.
pvary commented on a change in pull request #2612:
URL: https://github.com/apache/hive/pull/2612#discussion_r699243555



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate

Review comment:
       Shouldn't we check that the corresponding transaction is not aborted, or open?

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate
+        stmt.execute("DELETE FROM \"COMPLETED_TXN_COMPONENTS\" WHERE CTC_WRITEID\" NOT IN ("+

Review comment:
       Materialized view invalidation is dependent on `CTC_UPDATE_DELETE` values, so I think we should keep different values if there are any. See `TxnHandler.getMaterializationInvalidationInfo`. Maybe @kasakrisz knows more about this.
   
   Also I think moving this query to `AcidHouseKeeperService` would be good, as this is housekeeping.

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate

Review comment:
       Got it. Thanks!

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate
+        stmt.execute("DELETE FROM \"COMPLETED_TXN_COMPONENTS\" WHERE CTC_WRITEID\" NOT IN ("+

Review comment:
       Should we just advise the user to decrease the frequency of the `AcidHouseKeeperService`? Or use a different config?
   
   IMHO it would be better than putting the code to a different place, just because of the frequency is lower there...
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on pull request #2612: HIVE-25503: Add cleanup for the duplicate COMPLETED_TXN_COMPONENTS entries

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on pull request #2612:
URL: https://github.com/apache/hive/pull/2612#issuecomment-920777855


   > Can we add test cases for this method?
   > Can we at least manually run these tests with the supported databases - the queries look scary 😄
   
   added unit test 
   performed manual test on all supported dbs using ITestDbTxnManager


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pvary commented on a change in pull request #2612: added dedup for the COMPLETED_TXN_COMPONENTS

Posted by GitBox <gi...@apache.org>.
pvary commented on a change in pull request #2612:
URL: https://github.com/apache/hive/pull/2612#discussion_r699243555



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate

Review comment:
       Shouldn't we check that the corresponding transaction is not aborted, or open?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ edited a comment on pull request #2612: HIVE-25503: Add cleanup for the duplicate COMPLETED_TXN_COMPONENTS entries

Posted by GitBox <gi...@apache.org>.
deniskuzZ edited a comment on pull request #2612:
URL: https://github.com/apache/hive/pull/2612#issuecomment-920777855


   > Can we add test cases for this method?
   > Can we at least manually run these tests with the supported databases - the queries look scary 😄
   
   - added unit test 
   - performed manual test on all supported dbs using ITestDbTxnManager


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on a change in pull request #2612: added dedup for the COMPLETED_TXN_COMPONENTS

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on a change in pull request #2612:
URL: https://github.com/apache/hive/pull/2612#discussion_r699251921



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate

Review comment:
       COMPLETED_TXN_COMPONENTS contains only committed txns. Aborted & open stay in TXN_COMPONENTS




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kasakrisz commented on a change in pull request #2612: added dedup for the COMPLETED_TXN_COMPONENTS

Posted by GitBox <gi...@apache.org>.
kasakrisz commented on a change in pull request #2612:
URL: https://github.com/apache/hive/pull/2612#discussion_r699351152



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate
+        stmt.execute("DELETE FROM \"COMPLETED_TXN_COMPONENTS\" WHERE CTC_WRITEID\" NOT IN ("+

Review comment:
       As far as I know compaction is also deletes records from the `COMPLETED_TXN_COMPONENTS` table. So after a source table of a materialized view is compacted incremental rebuild of the MV is no longer possible.
   Currently the only way to exploit the benefits fo incremental MV rebuild is synchronising compaction and MV rebuild schedule.
   
   If `AcidHouseKeeperService` runs more frequent than compaction it can lower the chances of an incremental MV rebuild.
   If I understand correctly this extra delete statement will be run only when a compaction is in progress. Can we keep it here? @pvary 

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate
+        stmt.execute("DELETE FROM \"COMPLETED_TXN_COMPONENTS\" WHERE CTC_WRITEID\" NOT IN ("+

Review comment:
       A default config value for `AcidHouseKeeperService` which equals the default compaction schedule is also good.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on pull request #2612: HIVE-25503: Add cleanup for the duplicate COMPLETED_TXN_COMPONENTS entries

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on pull request #2612:
URL: https://github.com/apache/hive/pull/2612#issuecomment-918100548


   > Sorry - missed the issue with the mat-views
   
   fixed by keeping the latest update/delete record


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kasakrisz commented on a change in pull request #2612: added dedup for the COMPLETED_TXN_COMPONENTS

Posted by GitBox <gi...@apache.org>.
kasakrisz commented on a change in pull request #2612:
URL: https://github.com/apache/hive/pull/2612#discussion_r699351152



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate
+        stmt.execute("DELETE FROM \"COMPLETED_TXN_COMPONENTS\" WHERE CTC_WRITEID\" NOT IN ("+

Review comment:
       As far as I know compaction is also deletes records from the `COMPLETED_TXN_COMPONENTS` table. So after a source table of a materialized view is compacted incremental rebuild of the MV is no longer possible.
   Currently the only way to exploit the benefits fo incremental MV rebuild is synchronising compaction and MV rebuild schedule.
   
   If `AcidHouseKeeperService` runs more frequent than compaction it can lower the chances of an incremental MV rebuild.
   If I understand correctly this extra delete statement will be run only when a compaction is in progress. Can we keep it here? @pvary 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on a change in pull request #2612: added dedup for the COMPLETED_TXN_COMPONENTS

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on a change in pull request #2612:
URL: https://github.com/apache/hive/pull/2612#discussion_r699251921



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate

Review comment:
       COMPLETED_TXN_COMPONENTS contains only committed txns. Aborted & open stay in TXN_COMPONENTS




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kasakrisz commented on a change in pull request #2612: added dedup for the COMPLETED_TXN_COMPONENTS

Posted by GitBox <gi...@apache.org>.
kasakrisz commented on a change in pull request #2612:
URL: https://github.com/apache/hive/pull/2612#discussion_r699351152



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate
+        stmt.execute("DELETE FROM \"COMPLETED_TXN_COMPONENTS\" WHERE CTC_WRITEID\" NOT IN ("+

Review comment:
       As far as I know compaction is also deletes records from the `COMPLETED_TXN_COMPONENTS` table. So after a source table of a materialized view is compacted incremental rebuild of the MV is no longer possible.
   Currently the only way to exploit the benefits fo incremental MV rebuild is synchronising compaction and MV rebuild schedule.
   
   If `AcidHouseKeeperService` runs more frequent than compaction it can lower the chances of an incremental MV rebuild.
   If I understand correctly this extra delete statement will be run only when a compaction is in progress. Can we keep it here? @pvary 

##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate
+        stmt.execute("DELETE FROM \"COMPLETED_TXN_COMPONENTS\" WHERE CTC_WRITEID\" NOT IN ("+

Review comment:
       A default config value for `AcidHouseKeeperService` which equals the default compaction schedule is also good.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] deniskuzZ commented on a change in pull request #2612: added dedup for the COMPLETED_TXN_COMPONENTS

Posted by GitBox <gi...@apache.org>.
deniskuzZ commented on a change in pull request #2612:
URL: https://github.com/apache/hive/pull/2612#discussion_r702684038



##########
File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java
##########
@@ -93,6 +93,11 @@ public CompactionTxnHandler() {
       try {
         dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
         stmt = dbConn.createStatement();
+        // De-duplicate
+        stmt.execute("DELETE FROM \"COMPLETED_TXN_COMPONENTS\" WHERE CTC_WRITEID\" NOT IN ("+

Review comment:
       moved cleanup to the AcidHouseKeeperService




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org