Skip to content

Create StoredTabletFile to use in different situations#1519

Merged
milleruntime merged 7 commits intoapache:masterfrom
milleruntime:update-TabletFile
Feb 27, 2020
Merged

Create StoredTabletFile to use in different situations#1519
milleruntime merged 7 commits intoapache:masterfrom
milleruntime:update-TabletFile

Conversation

@milleruntime
Copy link
Contributor

  • Created methods for read/insert/updateDel and have them called
    throughout the code for the appropriate situation
  • Throw exception if we try to get metadata for update or delete and one
    does not exist
  • Call inserted() method on TabletFile to update metadata entry when a
    file is new and inserted
  • Drop FileUtil.toPathStrings() and use object collections instead
  • Replace String path with TabletFile in FileUtil

tablet.putTime(time);
estSizes.forEach(tablet::putFile);

// TODO check to see if we need to delete.. putBulkFile does an insert
Copy link
Member

Choose a reason for hiding this comment

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

Should resolve this before merge, or create follow-on task.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is OK since it is only called by the 2 bulk import methods. And each has a corresponding CleanupBulkImport FATE operations which callsMetadataTableUtil.removeBulkLoadEntries()

milleruntime and others added 3 commits February 21, 2020 09:10
* Created methods for read/insert/updateDel and have them called
throughout the code for the appropriate situation
* Throw exception if we try to get metadata for update or delete and one
does not exist
* Call inserted() method on TabletFile to update metadata entry when a
file is new and inserted
* Drop FileUtil.toPathStrings() and use object collections instead
* Replace String path with TabletFile in FileUtil
Co-Authored-By: Keith Turner <kturner@apache.org>
@ctubbsii
Copy link
Member

@milleruntime I can't tell if you're still working on this or if it's ready for re-review. If you want a re-review, feel free to tag me.

@milleruntime
Copy link
Contributor Author

@milleruntime I can't tell if you're still working on this or if it's ready for re-review. If you want a re-review, feel free to tag me.

I am still working on this... I started another branch since these changes are involved. I will merge it with this branch and ping you when its ready.

* New class that extends TabletFile for situations where we need to
update or delete a TabletFile or read it directly from metadata
@milleruntime
Copy link
Contributor Author

@ctubbsii I made the updates you and @keith-turner suggested so this PR can be reviewed. I know of at least 1 IT that is failing, SplitRecoveryIT that i am still trying to fix.

Copy link
Contributor

@keith-turner keith-turner left a comment

Choose a reason for hiding this comment

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

The change to add the more specific type is nice.

@milleruntime
Copy link
Contributor Author

@keith-turner I added a TODO to take a close look at the compaction code here. I noticed a difference in the order metadata is updated between minor and major compactions. During minor compactions, we update the metadata table first and then update the Tablet data in memory. Major compactions update the tablet data in memory first (with the tablet lock) then outside the lock wait for scans and then finally update the metadata table. Do you know why the metadata isn't updated first during major compaction?

@keith-turner
Copy link
Contributor

https://issues.apache.org/jira/browse/ACCUMULO-18

@milleruntime
Copy link
Contributor Author

Seeing a failure in BadIteratorMincIT:

2020-02-26 16:13:35,689 [tablet.Compactor] ERROR: null
java.lang.NullPointerException
        at org.apache.accumulo.test.functional.BadIterator.hasTop(BadIterator.java:36)
        at org.apache.accumulo.tserver.tablet.Compactor.compactLocalityGroup(Compactor.java:380)
        at org.apache.accumulo.tserver.tablet.Compactor.call(Compactor.java:231)
        at org.apache.accumulo.tserver.tablet.MinorCompactor.call(MinorCompactor.java:128)
        at org.apache.accumulo.tserver.tablet.Tablet.minorCompact(Tablet.java:820)
        at org.apache.accumulo.tserver.tablet.MinorCompactionTask.run(MinorCompactionTask.java:94)
        at org.apache.accumulo.fate.util.LoggingRunnable.run(LoggingRunnable.java:37)
        at org.apache.htrace.wrappers.TraceRunnable.run(TraceRunnable.java:57)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at org.apache.accumulo.fate.util.LoggingRunnable.run(LoggingRunnable.java:37)
        at java.base/java.lang.Thread.run(Thread.java:834)

Copy link
Member

@ctubbsii ctubbsii left a comment

Choose a reason for hiding this comment

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

+1 overall; I like the TabletFile superclass / StoredTabletFile subclass mechanism.

@milleruntime milleruntime changed the title Update TabletFile to use getters for different situations Create StoredTabletFile to use in different situations Feb 27, 2020
@ctubbsii ctubbsii linked an issue Feb 27, 2020 that may be closed by this pull request
@milleruntime milleruntime merged commit 94844b3 into apache:master Feb 27, 2020
@milleruntime milleruntime deleted the update-TabletFile branch February 27, 2020 18:38
milleruntime added a commit to milleruntime/accumulo that referenced this pull request Oct 7, 2020
* Replace remaining uses with Path objects and removed unnecessary
wrapping of intermediate objects
* Replaced with more specific types introduced in apache#1519 and apache#1501
* This class was confusing and ambiguous
milleruntime added a commit to milleruntime/accumulo that referenced this pull request Oct 7, 2020
* Replace remaining uses with Path objects and removed unnecessary
wrapping of intermediate objects
* Replaced with more specific types introduced in apache#1519 and apache#1501
* This class was confusing and ambiguous
@milleruntime milleruntime mentioned this pull request Oct 7, 2020
ctubbsii added a commit that referenced this pull request Oct 8, 2020
* Drop FileRef class

* Replace remaining uses with Path objects and removed unnecessary
wrapping of intermediate objects
* Replaced with more specific types introduced in #1519 and #1501
* This class was confusing and ambiguous

* PR Feedback for #1726 (milleruntime#14)

* Remove unneeded Ample interface (and unneeded 'public' keywords)
* Update Ample.deleteBulkFile to use TabletFile (currently not used by
  any code, but presumably, this will make it easier to update existing
  code to use this method when it is migrated to use Ample)
* Use HashSet instead of HashMap in CopyFailed.java
* Remove unnecessary toString in CopyFailed.java

Co-authored-by: Christopher Tubbs <ctubbsii@apache.org>
milleruntime added a commit to milleruntime/accumulo that referenced this pull request Sep 29, 2022
* Revert some changes to FileUtil that used TabletFile. If a tablet is
splitting and exceeds the tserver.tablet.split.midpoint.files.max then
we will reduce the number of index files using temporary files. These
temporary files don't conform to standard TabletFile directories so just
use strings in this special case.
milleruntime added a commit to milleruntime/accumulo that referenced this pull request Sep 29, 2022
* Revert some changes to FileUtil that used TabletFile. If a tablet is
splitting and exceeds the tserver.tablet.split.midpoint.files.max then
we will reduce the number of index files using temporary files. These
temporary files don't conform to standard TabletFile directories so just
use strings in this special case.
* Closes apache#2977
milleruntime added a commit that referenced this pull request Sep 29, 2022
* Revert some changes to FileUtil that used TabletFile. If a tablet is
splitting and exceeds the tserver.tablet.split.midpoint.files.max then
we will reduce the number of index files using temporary files. These
temporary files don't conform to standard TabletFile directories so just
use strings in this special case.
* Closes #2977
@ctubbsii ctubbsii added this to the 2.1.0 milestone Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Throw Exception to prevent incorrect metadata

3 participants