keith-turner commented on a change in pull request #2320:
URL: https://github.com/apache/accumulo/pull/2320#discussion_r752627377
##########
File path:
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
##########
@@ -1421,6 +1417,26 @@ private void closeConsistencyCheck() {
// TODO check lastFlushID and lostCompactID - ACCUMULO-1290
}
+ private void compareToDataInMemory(TabletMetadata tabletMetadata) {
+ if
(!tabletMetadata.getFilesMap().equals(getDatafileManager().getDatafileSizes()))
{
+ String msg = "Data files in " + extent + " differ from in-memory data "
+ + tabletMetadata.getFilesMap() + " " +
getDatafileManager().getDatafileSizes();
+ log.error(msg);
+ throw new RuntimeException(msg);
Review comment:
Probably do not want to throw an exception here as it will not lead to
anything useful since this is being called by a timer thread. For now logging
the error seems good.
Would probably be good to look into opening up a follow on issue about
taking automated action when this is detected (something more than logging an
error). Not sure what automated action would be best to take, but could imagine
many possible actions (could make the tablet non-functional, report something
on the monitor, etc).
```suggestion
```
##########
File path:
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
##########
@@ -2231,6 +2247,10 @@ DatafileManager getDatafileManager() {
return datafileManager;
}
+ public long getUpdateCount() {
Review comment:
Need to sync this or make the var volatile. Sync and volatile both
force memory consistency to ensure we get the latest value from main memory and
not some older value sitting in a processor cache. Using sync also gives
mutual exclusion w/ map updates, where we will wait if another thread is
currently updating the map. I picked sync over volatile because it makes it
more consistent w/ other code w/o introducing volatile that is only needed for
this method and is not needed for the other sync methods.
```suggestion
public synchronized long getUpdateCount() {
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]