You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/01/27 03:51:43 UTC
[GitHub] [hive] aasha commented on a change in pull request #1897: HIVE-24674. Set repl.source.for property in the db if db is under repication
aasha commented on a change in pull request #1897:
URL: https://github.com/apache/hive/pull/1897#discussion_r565006196
##########
File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
##########
@@ -4086,8 +4086,6 @@ public void testDumpWithPartitionDirMissing() throws IOException {
@Test
public void testDumpNonReplDatabase() throws IOException {
Review comment:
can this test itself be removed?
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java
##########
@@ -177,11 +177,6 @@ private void initReplDump(ASTNode ast) throws HiveException {
for (String dbName : Utils.matchesDb(db, dbNameOrPattern)) {
Database database = db.getDatabase(dbName);
if (database != null) {
- if (!isMetaDataOnly && !ReplChangeManager.isSourceOfReplication(database)) {
Review comment:
Is a check needed on the load side for upgrade scenarios? Say source cluster is not upgraded but the target is.
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java
##########
@@ -873,6 +875,28 @@ Long bootStrapDump(Path dumpRoot, DumpMetaData dmd, Path cmRoot, Hive hiveDb)
throw new HiveException("Replication dump not allowed for replicated database" +
" with first incremental dump pending : " + dbName);
}
+
+ if (db != null && !HiveConf.getBoolVar(conf, REPL_DUMP_METADATA_ONLY)) {
+ if (!ReplChangeManager.isSourceOfReplication(db)) {
+ // Check if the schedule name is available else set the query value
+ // as default.
+ String value = conf.get(SCHEDULED_QUERY_SCHEDULENAME,
+ "default_" + getQueryState().getQueryString());
+ Map<String, String> params = db.getParameters();
+ if (params != null) {
+ params.put("repl.source.for", value);
Review comment:
If repl.source.for is already set for a particular db with a policy p1 and a new policy is created say p2. p2 should be appended to p1.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org