Skip to content

Conversation

@klcopp
Copy link
Contributor

@klcopp klcopp commented Jan 5, 2021

What changes were proposed in this pull request?

Rename compaction 'attempted' status to 'did not initiate'

Why are the changes needed?

See HIVE-24587.

Does this PR introduce any user-facing change?

Show compactions and sys.COMPACTIONS tables will list "attempted" status as "did not initiate" now.

How was this patch tested?

Unit test for case of initiator failure.

ShowCompactResponse rsp = txnHandler.showCompact(new ShowCompactRequest());
List<ShowCompactResponseElement> compacts = rsp.getCompacts();
Assert.assertEquals(1, compacts.size());
Assert.assertEquals("did not initiate", compacts.get(0).getState());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that in Initiator.scheduleCompactionIfRequired the exception is not passed to CompactionInfo, so it won't get saved. Could you also fix that, and here you could check if it was saved correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, will do!

@pvargacl
Copy link
Contributor

pvargacl commented Jan 7, 2021

You should also modify the COMPACTIONS view in sys db (hive-schema-4.0.0.hive.sql)

@pvargacl
Copy link
Contributor

pvargacl commented Jan 7, 2021

LGTM +1

COMPACTOR_HISTORY_RETENTION_ATTEMPTED("hive.compactor.history.retention.attempted", 2,
new RangeValidator(0, 100), "Determines how many attempted compaction records will be " +
"retained in compaction history for a given table/partition."),
@Deprecated COMPACTOR_HISTORY_RETENTION_DID_NOT_INITIATE("hive.compactor.history.retention.attempted", 2,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use configuration deprecation to change the name of the config as well? Otherwise we will carry this baggage forever.

import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;

import static org.apache.hadoop.hive.ql.txn.compactor.CompactorTestUtilities.CompactorThreadType;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why static import?

Copy link
Contributor

@pvary pvary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 pending tests

Copy link
Contributor

@pvary pvary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @klcopp! +1 LGTM

@klcopp klcopp merged commit a8f9ed5 into apache:master Jan 12, 2021
@klcopp klcopp deleted the HIVE-24586 branch January 12, 2021 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants