Hello Impala Public Jenkins,

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/23194

to look at the new patch set (#4).

Change subject: IMPALA-14220 (part 2): Delay AcceptRequest until catalog is 
stable
......................................................................

IMPALA-14220 (part 2): Delay AcceptRequest until catalog is stable

CatalogD availability is improving since reading is_active_ no longer
requires holding catalog_lock_. However, during a failover scenario,
requests may slip into the passive-turn-to-active CatalogD and obtain
stale metadata.

This patch improves the situation in two steps. First, it adds a new
mutex ha_transition_lock_ that must be obtained by AcceptRequest() in HA
mode. This mutex protects both CatalogServer::WaitHATransition() and
CatalogServer::UpdateActiveCatalogd(). WaitHATransition() will only exit
and return to AcceptRequest() after the triggered_first_reset_ flag is
True (initial metadata reset has completed) or
min_catalog_version_to_serve_ is met. If only the latter happens,
request will goes through the Catalog JVM and subsequently blocked by
CatalogResetManager.waitOngoingMetadataFetch() until metadata reset has
progress beyond requested database/table.

Second, it increments the catalog version by
CATALOG_VERSION_INCREMENT_ON_RESET (100) on every global
reset (Invalidate Metadata) initiated by catalog-server.cc.
CatalogServer::MarkPendingMetadataReset() matches this logic to
increment min_catalog_version_to_serve_ before setting
triggered_first_reset_ flag to False (consequently waking up
TriggerResetMetadata thread).

Rename WaitForCatalogReady() to
WaitCatalogReadinessForWorkloadManagement() since this wait mechanism is
specific to Workload Management initialization and has stricter
requirements.

Change is_active_ and triggered_first_reset_ to volatile boolean. Also
inline CatalogServer::IsActive().

Testing:
Added test_metadata_after_failover_with_delayed_reset and
test_metadata_after_failover_with_hms_sync.

Change-Id: I370d21319335318e441ec3c3455bac4227803900
---
M be/src/catalog/catalog-server.cc
M be/src/catalog/catalog-server.h
M be/src/catalog/catalogd-main.cc
M be/src/catalog/workload-management-init.cc
M fe/src/main/java/org/apache/impala/catalog/Catalog.java
M fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java
M fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
M tests/custom_cluster/test_catalogd_ha.py
8 files changed, 160 insertions(+), 67 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/94/23194/4
--
To view, visit http://gerrit.cloudera.org:8080/23194
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I370d21319335318e441ec3c3455bac4227803900
Gerrit-Change-Number: 23194
Gerrit-PatchSet: 4
Gerrit-Owner: Riza Suminto <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Riza Suminto <[email protected]>

Reply via email to