HBASE-490 Doubly-assigned .META.; master uses one and clients another

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@633597 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-03-04 19:25:14 +00:00
parent ab8b5920a9
commit 36b5f4791f
6 changed files with 21 additions and 26 deletions

View File

@ -28,6 +28,7 @@ Hbase Change Log
HBASE-462 Update migration tool
HBASE-473 When a table is deleted, master sends multiple close messages to
the region server
HBASE-490 Doubly-assigned .META.; master uses one and clients another
IMPROVEMENTS
HBASE-415 Rewrite leases to use DelayedBlockingQueue instead of polling

View File

@ -372,21 +372,13 @@ abstract class BaseScanner extends Chore implements HConstants {
}
/*
* If the server is not dead and either:
* the stored info is not null and the start code does not match
* or:
* the stored info is null and the region is neither unassigned nor pending
* then:
* If the server is a dead server or its startcode is off -- either null
* or doesn't match the start code for the address -- then add it to the
* list of unassigned regions IF not already there (or pending open).
*/
if (!deadServer &&
((storedInfo != null && storedInfo.getStartCode() != startCode) ||
(storedInfo == null &&
!regionManager.isUnassigned(info) &&
if (!deadServer && !regionManager.isUnassigned(info) &&
!regionManager.isPending(info.getRegionName())
)
)
) {
&& (storedInfo == null || storedInfo.getStartCode() != startCode)) {
// The current assignment is invalid
if (LOG.isDebugEnabled()) {
LOG.debug("Current assignment of " + info.getRegionName() +

View File

@ -38,7 +38,7 @@ import org.apache.hadoop.hbase.RemoteExceptionHandler;
* action would prevent other work from getting done.
*/
class MetaScanner extends BaseScanner {
/** Work for the meta scanner is queued up here */
/** Initial work for the meta scanner is queued up here */
private volatile BlockingQueue<MetaRegion> metaRegionsToScan =
new LinkedBlockingQueue<MetaRegion>();
@ -50,10 +50,10 @@ class MetaScanner extends BaseScanner {
super(master, regionManager, false, master.metaRescanInterval, master.closed);
}
// Don't retry if we get an error while scanning. Errors are most often
// caused by the server going away. Wait until next rescan interval when
// things should be back to normal
private boolean scanOneMetaRegion(MetaRegion region) {
// Don't retry if we get an error while scanning. Errors are most often
// caused by the server going away. Wait until next rescan interval when
// things should be back to normal
boolean scanSuccessful = false;
while (!master.closed.get() && !regionManager.isInitialRootScanComplete() &&
regionManager.getRootRegionLocation() == null) {
@ -95,7 +95,9 @@ class MetaScanner extends BaseScanner {
@Override
protected boolean initialScan() {
MetaRegion region = null;
while (!master.closed.get() && region == null && !metaRegionsScanned()) {
while (!master.closed.get() &&
(region == null && metaRegionsToScan.size() > 0) &&
!metaRegionsScanned()) {
try {
region = metaRegionsToScan.poll(master.threadWakeFrequency,
TimeUnit.MILLISECONDS);

View File

@ -598,7 +598,7 @@ class RegionManager implements HConstants {
public void waitForRootRegionLocation() {
synchronized (rootRegionLocation) {
while(!master.closed.get() && rootRegionLocation.get() == null) {
while (!master.closed.get() && rootRegionLocation.get() == null) {
// rootRegionLocation will be filled in when we get an 'open region'
// regionServerReport message from the HRegionServer that has been
// allocated the ROOT region below.

View File

@ -31,10 +31,10 @@ class RootScanner extends BaseScanner {
super(master, regionManager, true, master.metaRescanInterval, master.closed);
}
// Don't retry if we get an error while scanning. Errors are most often
// caused by the server going away. Wait until next rescan interval when
// things should be back to normal
private boolean scanRoot() {
// Don't retry if we get an error while scanning. Errors are most often
// caused by the server going away. Wait until next rescan interval when
// things should be back to normal
boolean scanSuccessful = false;
master.waitForRootRegionLocation();
if (master.closed.get()) {

View File

@ -44,7 +44,7 @@ public class Sleeper {
* Sleep for period.
*/
public void sleep() {
sleep(period);
sleep(System.currentTimeMillis());
}
/**