Skip to content

HIVE-19089 : Create/Replicate AllocWriteId Event#329

Closed
maheshk114 wants to merge 6 commits into
apache:masterfrom
maheshk114:BUG-95522-95521
Closed

HIVE-19089 : Create/Replicate AllocWriteId Event#329
maheshk114 wants to merge 6 commits into
apache:masterfrom
maheshk114:BUG-95522-95521

Conversation

@maheshk114
Copy link
Copy Markdown
Contributor

EVENT_ALLOCATE_WRITE_ID
Source Warehouse:

Create new event type EVENT_ALLOCATE_WRITE_ID with related message format etc.
Capture this event when allocate a table write ID from the sequence table by ACID operation.
Repl dump should read this event from EventNotificationTable and dump the message.
Target Warehouse:

Repl load should read the event from the dump and get the message.
Validate if source txn ID from the event is there in the source-target txn ID map. If not there, just noop the event.
If valid, then Allocate table write ID from sequence table
Extend listener notify event API to add two new parameter , dbconn and sqlgenerator to add the events to notification_log table within the same transaction

@maheshk114 maheshk114 changed the title Create/Replicate AllocWriteId Event HIVE-19089 : Create/Replicate AllocWriteId Event Apr 3, 2018
return 0;
case REPL_ALLOC_WRITE_ID:
List<Long> targetTxnIds = txnManager.replGetTargetTxnIds(replPolicy, work.getTxnIds());
txnManager.allocateTableWriteIdsBatch(targetTxnIds, work.getDbName(), work.getTableName());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of 2 metastore calls, it can be just one method replAllocateTableWriteIdsBatch which takes replPolicy, srcTxnsIds and writeIds as input. If input is valid, then take repl flow and get targetTxnId and allocate writeId. In fact AllocateTableWriteIdsRequest can be modified to take optional repl arguments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove gettargettxn id and pass replpolicy, txntowriteid list in the request

this.tableName = tableName;
}

public String getReplPolicy() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getReplPolicy can be a utility function which takes db and table name as input. This can be kept in a separate ql/parse/load/Utils.java class. This makes ReplTxnWork class very clean where we set db/table name only in constructor and replPolicy is just an input.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move the construction of repl policy to a utility class

@@ -250,7 +250,8 @@ private boolean shouldReplayEvent(FileStatus dir, DumpType dumpType) throws Sema
// repl id stored in the database/table is valid.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this method shouldReplayEvent as all txn events are idempotent when it reaches metastore and able to find it from REPL_TO_TXN_MAP table?
Yes, this may help for the case where we repeat OPEN-ABORT/COMMIT events. But, even with this method, we cannot guarantee idempotent behaviour as db/table name can be null here. So, better to push this low level before allocating writeID or copy data files during commit. Also, need to check it on each tables if a particular commit operates on multiple tables.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this if check ..let it filer it for all operation

Copy link
Copy Markdown
Contributor Author

@maheshk114 maheshk114 Apr 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if some checks can be done at lower layer based on table/partition object specially for write with commit and alloc write id events

if (txnIds != null && listeners != null && !listeners.isEmpty()) {
MetaStoreListenerNotifier.notifyEvent(listeners, EventType.OPEN_TXN,
new OpenTxnEvent(txnIds, this));
MetaStoreListenerNotifier.notifyTxnEvent(listeners, EventType.OPEN_TXN,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall use original notify() method itself if last 2 parameters are null. Also, add implementation for the same.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert back this call to notifyevent . change notifyTxnEvent to notifyEventDirectSql and change the interface name also

AllocateTableWriteIdsResponse response = getTxnHandler().allocateTableWriteIds(rqst);
if (listeners != null && !listeners.isEmpty()) {
MetaStoreListenerNotifier.notifyTxnEvent(listeners, EventType.ALLOC_WRITE_ID,
new AllocWriteIdEvent(rqst.getTxnIds(), rqst.getTableName(), this), null, null);
Copy link
Copy Markdown
Contributor

@sankarh sankarh Apr 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AllocateWriteIdEvent should take writeIds as well to ensure idempotent behaviour in target when apply. Better to pass TxnToWriteId list.
Also, shouldn't use the regular allocate writeid flow in target. For repl flow, need to check if the latest allocated writeid > requested writeid, then noop. If allocated writeid < requested writeid, then throw exception as it is invalid usage where they skipped some events.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore if its greater and fail load if its smaller

* map if no parameters were updated or if no listeners were notified.
* @throws MetaException If an error occurred while calling the listeners.
*/
public static Map<String, String> notifyTxnEvent(List<? extends MetaStoreEventListener> listeners,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall name is more generic to denote directSQL implementation. I would suggest notifyEventWithDirectSql()

public class AllocWriteIdEvent extends ListenerEvent {

private final List<Long> txnIds;
private final String tableName;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even database name should be part of the event, else, how can we filter this event for given database during REPL DUMP? Also, it may end of allocating write id on a table which was not intended to. For reference, Create table event takes DB name as input.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change it to txntowriteid list and add dbname also

(event.getEventType().equals(MessageFactory.COMMIT_TXN_EVENT)) ||
(event.getEventType().equals(MessageFactory.ABORT_TXN_EVENT))
(event.getEventType().equals(MessageFactory.ABORT_TXN_EVENT)) ||
(event.getEventType().equals(MessageFactory.ALLOC_WRITE_ID_EVENT))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allocate write ID is a DB/table related event and should be ignored if not lookup on this DB/table.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this check for alloc write id

@maheshk114 maheshk114 force-pushed the BUG-95522-95521 branch 2 times, most recently from 22b3335 to 09a5a19 Compare April 8, 2018 04:26
tbl = context.db.getTable(dbName, tableName);
} catch (InvalidTableException e) {
// return a empty list if table does not exist.
return new ArrayList<>();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the current dump have both create table and allocate write id events, then this table object would be missing in metastore. But this is a valid scenario and need to allocate write id. Shall refer to last repl ID if database object to decide this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During load, by the time alloc write id is replayed ..create table should have been done.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move all these check to replTxntask

//context table name is passed to ReplTxnWork , as the repl policy will be created based
//on this table name. ReplPolicy is used to extract the target transaction id based on source
//transaction id.
ReplTxnWork work = new ReplTxnWork(dbName, context.tableName, ReplTxnWork.OperationType.REPL_ALLOC_WRITE_ID,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shall directly set tableName instead of setting it later. replPolicy can be passed as input.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be done

int numTxn = 50000;
List<Long> txnList = openTxnForTest(1, numTxn, "default.*");
assert(txnList.size() == numTxn);
txnHandler.abortTxns(new AbortTxnsRequest(txnList));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are we testing here? No verification after abort.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the assert is added in the common function oopenTxnFortest

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the assert ..just count the number of entry added for repltotxnmap

}
allocMsg = new AllocateTableWriteIdsRequest("default1", "tbl1");
allocMsg.setReplPolicy("default1.*");
allocMsg.setTxnToWriteIdList(txnToWriteId);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, the input txnid should be that of source (default). Not target(default1) txn ids.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here the transactions are started as target only ..and then those txn ids are passed to alloc the write id

Copy link
Copy Markdown
Contributor Author

@maheshk114 maheshk114 Apr 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the txn list to source and update the asserts

allocMsg.setReplPolicy("default1.*");
allocMsg.setTxnToWriteIdList(txnToWriteId);
txnToWriteId1 = txnHandler.allocateTableWriteIds(allocMsg).getTxnToWriteIds();
assert (txnToWriteId.equals(txnToWriteId1));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result may not match as txn id of source and target doesn't match. However, you can validate if txn id mapped to write id properly or not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The txns are always target txn ids only

}
}

private List<Long> getValidTxnIds(AllocateTableWriteIdsRequest rqst, Statement stmt, ResultSet rs)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name can be better such as checkAndGetTargetTxnIds.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be done


int size = txnToWriteIds.size();
for (TxnToWriteId txnToWriteId : txnToWriteIds) {
Long targetTxnId = getTargetTxnId(rqst.getReplPolicy(), txnToWriteId.getTxnId(), stmt);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation of getTargetTxnId can be changed to take list of source txn ids and use IN condition for queries.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in can not guarantee the input to output map ..we may not get the target txn id correctly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// Request msg to allocate table write ids for the given list of txns
struct AllocateTableWriteIdsRequest {
1: required list<i64> txnIds,
1: optional list<i64> txnIds,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional members can be moved to bottom and keep repl related members together.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

txnIds is not replication related ..it will be used by normal flow ..so have kept it at the starting

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

2: required string dbName,
3: required string tableName,
4: optional string replPolicy,
5: optional list<TxnToWriteId> txnToWriteIdList,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename as srcTxnToWriteIdList. Also, add a comment that txn and write ids in this list are assumed to be sorted in ascending order and are in continuous sequence.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


// Get the next write id for the table and check if its in consistent with the input txntowriteids.
String s = sqlGenerator.addForUpdateClause(
"select nwi_next from NEXT_WRITE_ID where nwi_database = " + quoteString(dbName)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next_write_id is queried twice in this allocate write id flow. One here and other by caller after this call.
Add a comment, that this query is run under read-committed connection but still it is guaranteed that repeated query on next_write_id within this connection is consistent as this is repl flow and we assume that only repl task would allocate write id.
Also, check if we can refactor and avoid this repeated call.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@maheshk114 maheshk114 force-pushed the BUG-95522-95521 branch 2 times, most recently from 627b08c to 6f993ea Compare April 10, 2018 18:23
long txnId = txnList.get((int) i);
assertEquals(i + startId, txnId);
}
int numTxnPresentNow = TxnDbUtil.countQueryAgent(conf, "select count(*) from TXNS");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of 2 queries on TXNS table, shall add where clause for range of txnids allocated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

" and RTM_REPL_POLICY = \'" + replPolicy + "\'");
assertEquals(numReplTxns, targetTxnId.size());

String[] output = TxnDbUtil.queryToString(conf, "select RTM_TARGET_TXN_ID from REPL_TXN_MAP where " +
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of 2 queries, can't we just compare the size of "output" for count?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

public void testReplOpenTxn() throws Exception {
int numTxn = 50000;
List<Long> txnList = openTxnForTest(1, numTxn, "default.*");
int numTxnPresentStart = TxnDbUtil.countQueryAgent(conf, "select count(*) from TXNS");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused query result. Redundant code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

allocMsg = new AllocateTableWriteIdsRequest("default", "tbl");
allocMsg.setReplPolicy("default.*");
allocMsg.setTxnToWriteIdList(txnToWriteId);
allocMsg.setSrcTxnToWriteIdList(txnToWriteId);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an invalid usage where write ids are allocated using normal flow first and then through repl flow. Also, the input txnToWriteId should be that of source but here it is that of target itself.
For idempotent case, we call same method twice with same input parameters.
I think, we shall remove this code here as idempotent case is verified somewhere below this test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


for (int idx = 0; idx < txnList.size(); idx++) {
txnToWriteId.add(new TxnToWriteId(txnList.get(idx), idx+1));
txnToWriteId.add(new TxnToWriteId(startTxnId+idx, idx+1));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use appropriate variable names such as srcTxnToWriteId for input and targetTxnToWriteId for output.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

Collections.sort(txnIds); //easier to read logs
Collections.sort(txnIds); //easier to read logs and for assumption done in replication flow
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What assumption in replication flow?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* @throws LockException
*/
void replAllocateTableWriteIdsBatch(String dbName, String tableName, String replPolicy,
List<TxnToWriteId> txnToWriteIdList) throws LockException;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to srcTxnToWriteIdList.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}
@Override
public void replAllocateTableWriteIdsBatch(String dbName, String tableName,
String replPolicy, List<TxnToWriteId> txnToWriteIdList) throws LockException {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to srcTxnToWriteIdList.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

public void replAllocateTableWriteIdsBatch(String dbName, String tableName,
String replPolicy, List<TxnToWriteId> txnToWriteIdList) throws LockException {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to srcTxnToWriteIdList.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

String tableName = (context.tableName != null && !context.tableName.isEmpty() ? context.tableName : msg
.getTableName());

//context table name is passed to ReplTxnWork , as the repl policy will be created based
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

LOG.debug("Table does not exist so, ignoring the operation");
//TODO : need to return if table does not exist. Will be done once acid table replication is implemented.
//return 0;
LOG.info("Table does not exist so, ignoring the operation");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit the comment to include that this could be idempotent case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

ReplicationSpec replicationSpec = work.getReplicationSpec();
if (replicationSpec != null && !replicationSpec.allowReplacementInto(tbl.getParameters())) {
// if the event is already replayed, then no need to replay it again.
LOG.debug("ReplTxnTask: Event is skipped as it is already replayed");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall log the event type and event id.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return true;
}
if (tbl != null) {
Map<String, String> params = tbl.getParameters();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code snippet to validate repl state is duplicated for database case as well. Can we have a static method in ReplicationSpec which takes current event id and parameters map as arguments?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

private String server, servicePrincipal, dbName, tableName;

@JsonProperty
private List<Long> txnIdList, writeIdList;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we make list of TxnToWriteId in son format too? instead if 2 more lists.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

json does not support TxnToWriteId

}

@Override
public String getDbName() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 2 methods to get dbName?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the autogenerated one


import javax.sql.DataSource;

import com.google.common.collect.Lists;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import as we changed all to Collections.singletonList, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed it

s = sqlGenerator.addForUpdateClause(
"select nwi_next from NEXT_WRITE_ID where nwi_database = " + quoteString(dbName)
+ " and nwi_table = " + quoteString(tblName));
LOG.debug("Going to execute query <" + s + ">");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to move this select from bottom?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code refactoring to have one select per flow


if (txnIds.size() == 0) {
// Idempotent case for replication flow.
return new AllocateTableWriteIdsResponse(new ArrayList<>());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

txn leak. should rollback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connection close will rollback the transaction

@@ -1287,27 +1391,16 @@ public AllocateTableWriteIdsResponse allocateTableWriteIds(AllocateTableWriteIds
return new AllocateTableWriteIdsResponse(txnToWriteIds);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

txn leak here as well. need rollback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connection close will rollback the transaction

3: required string tableName,
1: required string dbName,
2: required string tableName,
3: optional list<i64> txnIds,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment saying either txnIds or replPolicy+srcTxnToWriteIdList can exist in a call.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

return txnIds;
public ReplTxnWork(String replPolicy, String dbName, String tableName, Long txnId,
OperationType type, ReplicationSpec replicationSpec) {
this(replPolicy, dbName, tableName, Lists.newArrayList(txnId), type, null, replicationSpec);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Singleton list can be used.

@maheshk114 maheshk114 force-pushed the BUG-95522-95521 branch 5 times, most recently from 28442c3 to bf712f7 Compare April 13, 2018 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants