Skip to content

Commit

Permalink
Removes race conditions between tablet refresh and minor compaction (#…
Browse files Browse the repository at this point in the history
…3634)

This commit moved the tablet twoards using a TabletMetadata object as
the source of the tablets files instead of tracking the files itself.
The move twoards using TabletMetadata support the changes to fix the
race conditions with tablet refresh.  Committing a minor compaction to
walogs and the metadata table is now mutually exclusive with refreshing
a tablets metadata.  Scans should always see a consistent view of the in
memory maps a tablet has and the files it has after this change.  Before
this change a tablet scan could see the file produced by a minor
compaction and the in memory map that was the source of that file.
Scans should only see one or the other.

fixes #3625
  • Loading branch information
keith-turner authored Jul 28, 2023
1 parent b01528f commit 7cf496a
Show file tree
Hide file tree
Showing 21 changed files with 511 additions and 1,493 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,6 @@ public enum Property {
+ " minor compacted file because it may have been modified by iterators. The"
+ " file dumped to the local dir is an exact copy of what was in memory.",
"1.3.5"),
TSERV_HEALTH_CHECK_FREQ("tserver.health.check.interval", "30m", PropertyType.TIMEDURATION,
"The time between tablet server health checks.", "2.1.0"),
TSERV_MINTHREADS("tserver.server.threads.minimum", "20", PropertyType.COUNT,
"The minimum number of threads to use to handle incoming requests.", "1.4.0"),
TSERV_MINTHREADS_TIMEOUT("tserver.server.threads.timeout", "0s", PropertyType.TIMEDURATION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ public static void bulkImported(KeyExtent extent, TabletFile file) {
fileLog.debug("Imported {} {} ", extent, file);
}

public static void recovering(KeyExtent extent, List<LogEntry> logEntries) {
public static void recovering(KeyExtent extent, Collection<LogEntry> logEntries) {
if (recoveryLog.isDebugEnabled()) {
List<String> logIds = logEntries.stream().map(LogEntry::getUniqueID).collect(toList());
recoveryLog.debug("For {} recovering data from walogs: {}", extent, logIds);
}
}

public static void recovered(KeyExtent extent, List<LogEntry> logEntries, long numMutation,
public static void recovered(KeyExtent extent, Collection<LogEntry> logEntries, long numMutation,
long numEntries) {
recoveryLog.info("For {} recovered {} mutations creating {} entries from {} walogs", extent,
numMutation, numEntries, logEntries.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,4 @@ public static void validate(String metadataEntry) {
public static StoredTabletFile of(final String metadataEntry) {
return new StoredTabletFile(metadataEntry);
}

}
Loading

0 comments on commit 7cf496a

Please sign in to comment.