[jira] [Updated] (HBASE-17924) Consider sorting the row order when processing multi() ops before taking rowlocks
[ https://issues.apache.org/jira/browse/HBASE-17924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Purtell updated HBASE-17924: --- Fix Version/s: 1.3.3 > Consider sorting the row order when processing multi() ops before taking > rowlocks > - > > Key: HBASE-17924 > URL: https://issues.apache.org/jira/browse/HBASE-17924 > Project: HBase > Issue Type: Improvement >Affects Versions: 1.1.8, 2.0.0 >Reporter: Andrew Purtell >Assignee: Allan Yang >Priority: Major > Fix For: 1.4.0, 1.3.3, 2.0.0 > > Attachments: HBASE-17924.patch, HBASE-17924.v0.patch, > HBASE-17924.v2.patch, HBASE-17924.v3.patch, HBASE-17924.v4.patch, > HBASE-17924.v5.patch > > > When processing a batch mutation, we take row locks in whatever order the > mutations were added to the multi op by the client. > > {noformat} > RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> > HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks > {noformat} > Or > {noformat} > RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> > HRegion#get > | HRegion#append > | HRegion#increment > | HRegionServer#doBatchOp -> HRegion#batchMutate -> > HRegion#doMiniBatchMutation > {noformat} > > multi() is fed by client APIs that accept a RowMutations object containing > actions for multiple rows. The container for ops inside RowMutations is an > ArrayList, which doesn't change the ordering of objects added to it. The > protobuf implementation of the messages for multi ops do not reorder the list > of actions. When processing multi ops we iterate over the actions in the > order rehydrated from protobuf. > We should discuss sorting the order of ops by row key when processing multi() > ops before taking row locks. Does this make lock ordering more predictable > for server side operations? Yes, but potentially surprising for the client, > right? Is there any legitimate reason we should take locks out of row key > sorted order because the client has structured the request as such? -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (HBASE-17924) Consider sorting the row order when processing multi() ops before taking rowlocks
[ https://issues.apache.org/jira/browse/HBASE-17924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Purtell updated HBASE-17924: --- Resolution: Fixed Hadoop Flags: Reviewed Fix Version/s: 1.4.0 Status: Resolved (was: Patch Available) Pushed to master and branch-1. > Consider sorting the row order when processing multi() ops before taking > rowlocks > - > > Key: HBASE-17924 > URL: https://issues.apache.org/jira/browse/HBASE-17924 > Project: HBase > Issue Type: Improvement >Affects Versions: 2.0.0, 1.1.8 >Reporter: Andrew Purtell >Assignee: Allan Yang > Fix For: 2.0.0, 1.4.0 > > Attachments: HBASE-17924.patch, HBASE-17924.v0.patch, > HBASE-17924.v2.patch, HBASE-17924.v3.patch, HBASE-17924.v4.patch, > HBASE-17924.v5.patch > > > When processing a batch mutation, we take row locks in whatever order the > mutations were added to the multi op by the client. > > {noformat} > RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> > HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks > {noformat} > Or > {noformat} > RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> > HRegion#get > | HRegion#append > | HRegion#increment > | HRegionServer#doBatchOp -> HRegion#batchMutate -> > HRegion#doMiniBatchMutation > {noformat} > > multi() is fed by client APIs that accept a RowMutations object containing > actions for multiple rows. The container for ops inside RowMutations is an > ArrayList, which doesn't change the ordering of objects added to it. The > protobuf implementation of the messages for multi ops do not reorder the list > of actions. When processing multi ops we iterate over the actions in the > order rehydrated from protobuf. > We should discuss sorting the order of ops by row key when processing multi() > ops before taking row locks. Does this make lock ordering more predictable > for server side operations? Yes, but potentially surprising for the client, > right? Is there any legitimate reason we should take locks out of row key > sorted order because the client has structured the request as such? -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Updated] (HBASE-17924) Consider sorting the row order when processing multi() ops before taking rowlocks
[ https://issues.apache.org/jira/browse/HBASE-17924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Allan Yang updated HBASE-17924: --- Attachment: HBASE-17924.v5.patch > Consider sorting the row order when processing multi() ops before taking > rowlocks > - > > Key: HBASE-17924 > URL: https://issues.apache.org/jira/browse/HBASE-17924 > Project: HBase > Issue Type: Improvement >Affects Versions: 2.0.0, 1.1.8 >Reporter: Andrew Purtell >Assignee: Allan Yang > Fix For: 2.0.0 > > Attachments: HBASE-17924.patch, HBASE-17924.v0.patch, > HBASE-17924.v2.patch, HBASE-17924.v3.patch, HBASE-17924.v4.patch, > HBASE-17924.v5.patch > > > When processing a batch mutation, we take row locks in whatever order the > mutations were added to the multi op by the client. > > {noformat} > RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> > HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks > {noformat} > Or > {noformat} > RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> > HRegion#get > | HRegion#append > | HRegion#increment > | HRegionServer#doBatchOp -> HRegion#batchMutate -> > HRegion#doMiniBatchMutation > {noformat} > > multi() is fed by client APIs that accept a RowMutations object containing > actions for multiple rows. The container for ops inside RowMutations is an > ArrayList, which doesn't change the ordering of objects added to it. The > protobuf implementation of the messages for multi ops do not reorder the list > of actions. When processing multi ops we iterate over the actions in the > order rehydrated from protobuf. > We should discuss sorting the order of ops by row key when processing multi() > ops before taking row locks. Does this make lock ordering more predictable > for server side operations? Yes, but potentially surprising for the client, > right? Is there any legitimate reason we should take locks out of row key > sorted order because the client has structured the request as such? -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Updated] (HBASE-17924) Consider sorting the row order when processing multi() ops before taking rowlocks
[ https://issues.apache.org/jira/browse/HBASE-17924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Allan Yang updated HBASE-17924: --- Attachment: HBASE-17924.v4.patch > Consider sorting the row order when processing multi() ops before taking > rowlocks > - > > Key: HBASE-17924 > URL: https://issues.apache.org/jira/browse/HBASE-17924 > Project: HBase > Issue Type: Improvement >Affects Versions: 2.0.0, 1.1.8 >Reporter: Andrew Purtell >Assignee: Allan Yang > Fix For: 2.0.0 > > Attachments: HBASE-17924.patch, HBASE-17924.v0.patch, > HBASE-17924.v2.patch, HBASE-17924.v3.patch, HBASE-17924.v4.patch > > > When processing a batch mutation, we take row locks in whatever order the > mutations were added to the multi op by the client. > > {noformat} > RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> > HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks > {noformat} > Or > {noformat} > RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> > HRegion#get > | HRegion#append > | HRegion#increment > | HRegionServer#doBatchOp -> HRegion#batchMutate -> > HRegion#doMiniBatchMutation > {noformat} > > multi() is fed by client APIs that accept a RowMutations object containing > actions for multiple rows. The container for ops inside RowMutations is an > ArrayList, which doesn't change the ordering of objects added to it. The > protobuf implementation of the messages for multi ops do not reorder the list > of actions. When processing multi ops we iterate over the actions in the > order rehydrated from protobuf. > We should discuss sorting the order of ops by row key when processing multi() > ops before taking row locks. Does this make lock ordering more predictable > for server side operations? Yes, but potentially surprising for the client, > right? Is there any legitimate reason we should take locks out of row key > sorted order because the client has structured the request as such? -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Updated] (HBASE-17924) Consider sorting the row order when processing multi() ops before taking rowlocks
[ https://issues.apache.org/jira/browse/HBASE-17924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Allan Yang updated HBASE-17924: --- Attachment: HBASE-17924.v3.patch > Consider sorting the row order when processing multi() ops before taking > rowlocks > - > > Key: HBASE-17924 > URL: https://issues.apache.org/jira/browse/HBASE-17924 > Project: HBase > Issue Type: Improvement >Affects Versions: 2.0.0, 1.1.8 >Reporter: Andrew Purtell >Assignee: Allan Yang > Fix For: 2.0.0 > > Attachments: HBASE-17924.patch, HBASE-17924.v0.patch, > HBASE-17924.v2.patch, HBASE-17924.v3.patch > > > When processing a batch mutation, we take row locks in whatever order the > mutations were added to the multi op by the client. > > {noformat} > RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> > HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks > {noformat} > Or > {noformat} > RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> > HRegion#get > | HRegion#append > | HRegion#increment > | HRegionServer#doBatchOp -> HRegion#batchMutate -> > HRegion#doMiniBatchMutation > {noformat} > > multi() is fed by client APIs that accept a RowMutations object containing > actions for multiple rows. The container for ops inside RowMutations is an > ArrayList, which doesn't change the ordering of objects added to it. The > protobuf implementation of the messages for multi ops do not reorder the list > of actions. When processing multi ops we iterate over the actions in the > order rehydrated from protobuf. > We should discuss sorting the order of ops by row key when processing multi() > ops before taking row locks. Does this make lock ordering more predictable > for server side operations? Yes, but potentially surprising for the client, > right? Is there any legitimate reason we should take locks out of row key > sorted order because the client has structured the request as such? -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Updated] (HBASE-17924) Consider sorting the row order when processing multi() ops before taking rowlocks
[ https://issues.apache.org/jira/browse/HBASE-17924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Allan Yang updated HBASE-17924: --- Attachment: HBASE-17924.v2.patch Updated a new patch. In this patch, I sorted ClientProtos.Action instead of Mutation. Since we need to remain the mapping relationship between ClientProtos.Action and mutation. But the problem of sorting ClientProtos.Action is that we can't use Bytes.CompareTo. I have to implement a comparator with less efficiency. If anyone have better way, please let me know. > Consider sorting the row order when processing multi() ops before taking > rowlocks > - > > Key: HBASE-17924 > URL: https://issues.apache.org/jira/browse/HBASE-17924 > Project: HBase > Issue Type: Improvement >Affects Versions: 2.0.0, 1.1.8 >Reporter: Andrew Purtell >Assignee: Allan Yang > Fix For: 2.0.0 > > Attachments: HBASE-17924.patch, HBASE-17924.v0.patch, > HBASE-17924.v2.patch > > > When processing a batch mutation, we take row locks in whatever order the > mutations were added to the multi op by the client. > > {noformat} > RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> > HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks > {noformat} > Or > {noformat} > RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> > HRegion#get > | HRegion#append > | HRegion#increment > | HRegionServer#doBatchOp -> HRegion#batchMutate -> > HRegion#doMiniBatchMutation > {noformat} > > multi() is fed by client APIs that accept a RowMutations object containing > actions for multiple rows. The container for ops inside RowMutations is an > ArrayList, which doesn't change the ordering of objects added to it. The > protobuf implementation of the messages for multi ops do not reorder the list > of actions. When processing multi ops we iterate over the actions in the > order rehydrated from protobuf. > We should discuss sorting the order of ops by row key when processing multi() > ops before taking row locks. Does this make lock ordering more predictable > for server side operations? Yes, but potentially surprising for the client, > right? Is there any legitimate reason we should take locks out of row key > sorted order because the client has structured the request as such? -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Updated] (HBASE-17924) Consider sorting the row order when processing multi() ops before taking rowlocks
[ https://issues.apache.org/jira/browse/HBASE-17924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Allan Yang updated HBASE-17924: --- Attachment: HBASE-17924.patch > Consider sorting the row order when processing multi() ops before taking > rowlocks > - > > Key: HBASE-17924 > URL: https://issues.apache.org/jira/browse/HBASE-17924 > Project: HBase > Issue Type: Improvement >Affects Versions: 2.0.0, 1.1.8 >Reporter: Andrew Purtell >Assignee: Allan Yang > Fix For: 2.0.0 > > Attachments: HBASE-17924.patch, HBASE-17924.v0.patch > > > When processing a batch mutation, we take row locks in whatever order the > mutations were added to the multi op by the client. > > {noformat} > RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> > HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks > {noformat} > Or > {noformat} > RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> > HRegion#get > | HRegion#append > | HRegion#increment > | HRegionServer#doBatchOp -> HRegion#batchMutate -> > HRegion#doMiniBatchMutation > {noformat} > > multi() is fed by client APIs that accept a RowMutations object containing > actions for multiple rows. The container for ops inside RowMutations is an > ArrayList, which doesn't change the ordering of objects added to it. The > protobuf implementation of the messages for multi ops do not reorder the list > of actions. When processing multi ops we iterate over the actions in the > order rehydrated from protobuf. > We should discuss sorting the order of ops by row key when processing multi() > ops before taking row locks. Does this make lock ordering more predictable > for server side operations? Yes, but potentially surprising for the client, > right? Is there any legitimate reason we should take locks out of row key > sorted order because the client has structured the request as such? -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Updated] (HBASE-17924) Consider sorting the row order when processing multi() ops before taking rowlocks
[ https://issues.apache.org/jira/browse/HBASE-17924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Allan Yang updated HBASE-17924: --- Fix Version/s: 2.0.0 Affects Version/s: 2.0.0 1.1.8 Status: Patch Available (was: Open) > Consider sorting the row order when processing multi() ops before taking > rowlocks > - > > Key: HBASE-17924 > URL: https://issues.apache.org/jira/browse/HBASE-17924 > Project: HBase > Issue Type: Improvement >Affects Versions: 1.1.8, 2.0.0 >Reporter: Andrew Purtell >Assignee: Allan Yang > Fix For: 2.0.0 > > Attachments: HBASE-17924.v0.patch > > > When processing a batch mutation, we take row locks in whatever order the > mutations were added to the multi op by the client. > > {noformat} > RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> > HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks > {noformat} > Or > {noformat} > RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> > HRegion#get > | HRegion#append > | HRegion#increment > | HRegionServer#doBatchOp -> HRegion#batchMutate -> > HRegion#doMiniBatchMutation > {noformat} > > multi() is fed by client APIs that accept a RowMutations object containing > actions for multiple rows. The container for ops inside RowMutations is an > ArrayList, which doesn't change the ordering of objects added to it. The > protobuf implementation of the messages for multi ops do not reorder the list > of actions. When processing multi ops we iterate over the actions in the > order rehydrated from protobuf. > We should discuss sorting the order of ops by row key when processing multi() > ops before taking row locks. Does this make lock ordering more predictable > for server side operations? Yes, but potentially surprising for the client, > right? Is there any legitimate reason we should take locks out of row key > sorted order because the client has structured the request as such? -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Updated] (HBASE-17924) Consider sorting the row order when processing multi() ops before taking rowlocks
[ https://issues.apache.org/jira/browse/HBASE-17924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Allan Yang updated HBASE-17924: --- Attachment: HBASE-17924.v0.patch upload a patch to sort before batchmutate > Consider sorting the row order when processing multi() ops before taking > rowlocks > - > > Key: HBASE-17924 > URL: https://issues.apache.org/jira/browse/HBASE-17924 > Project: HBase > Issue Type: Improvement >Reporter: Andrew Purtell > Attachments: HBASE-17924.v0.patch > > > When processing a batch mutation, we take row locks in whatever order the > mutations were added to the multi op by the client. > > {noformat} > RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> > HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks > {noformat} > Or > {noformat} > RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> > HRegion#get > | HRegion#append > | HRegion#increment > | HRegionServer#doBatchOp -> HRegion#batchMutate -> > HRegion#doMiniBatchMutation > {noformat} > > multi() is fed by client APIs that accept a RowMutations object containing > actions for multiple rows. The container for ops inside RowMutations is an > ArrayList, which doesn't change the ordering of objects added to it. The > protobuf implementation of the messages for multi ops do not reorder the list > of actions. When processing multi ops we iterate over the actions in the > order rehydrated from protobuf. > We should discuss sorting the order of ops by row key when processing multi() > ops before taking row locks. Does this make lock ordering more predictable > for server side operations? Yes, but potentially surprising for the client, > right? Is there any legitimate reason we should take locks out of row key > sorted order because the client has structured the request as such? -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Updated] (HBASE-17924) Consider sorting the row order when processing multi() ops before taking rowlocks
[ https://issues.apache.org/jira/browse/HBASE-17924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Purtell updated HBASE-17924: --- Description: When processing a batch mutation, we take row locks in whatever order the mutations were added to the multi op by the client. {noformat} RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks {noformat} Or {noformat} RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> HRegion#get | HRegion#append | HRegion#increment | HRegionServer#doBatchOp -> HRegion#batchMutate -> HRegion#doMiniBatchMutation {noformat} multi() is fed by client APIs that accept a RowMutations object containing actions for multiple rows. The container for ops inside RowMutations is an ArrayList, which doesn't change the ordering of objects added to it. The protobuf implementation of the messages for multi ops do not reorder the list of actions. When processing multi ops we iterate over the actions in the order rehydrated from protobuf. We should discuss sorting the order of ops by row key when processing multi() ops before taking row locks. Does this make lock ordering more predictable for server side operations? Yes, but potentially surprising for the client, right? Is there any legitimate reason we should take locks out of row key sorted order because the client has structured the request as such? was: When processing a batch mutation, we take row locks in whatever order the mutations were added to the multi op by the client. {noformat} RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks {noformat} Or {noformat} RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> HRegion#get | HRegion#append | HRegion#increment | HRegionServer#doBatchOp -> HRegion#batchMutate -> HRegion#doMiniBatchMutation {noformat} multi() is fed by client APIs that accept a RowMutations object containing actions for multiple rows. The container for ops inside RowMutations is an ArrayList, which doesn't change the ordering of objects added to it. We should discuss sorting the order of ops by row key when processing multi() ops before taking row locks. Does this make lock ordering more predictable for server side operations? Yes, but potentially surprising for the client, right? Is there any legitimate reason we should take locks out of row key sorted order because the client has structured the request as such? > Consider sorting the row order when processing multi() ops before taking > rowlocks > - > > Key: HBASE-17924 > URL: https://issues.apache.org/jira/browse/HBASE-17924 > Project: HBase > Issue Type: Improvement >Reporter: Andrew Purtell > > When processing a batch mutation, we take row locks in whatever order the > mutations were added to the multi op by the client. > > {noformat} > RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> > HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks > {noformat} > Or > {noformat} > RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> > HRegion#get > | HRegion#append > | HRegion#increment > | HRegionServer#doBatchOp -> HRegion#batchMutate -> > HRegion#doMiniBatchMutation > {noformat} > > multi() is fed by client APIs that accept a RowMutations object containing > actions for multiple rows. The container for ops inside RowMutations is an > ArrayList, which doesn't change the ordering of objects added to it. The > protobuf implementation of the messages for multi ops do not reorder the list > of actions. When processing multi ops we iterate over the actions in the > order rehydrated from protobuf. > We should discuss sorting the order of ops by row key when processing multi() > ops before taking row locks. Does this make lock ordering more predictable > for server side operations? Yes, but potentially surprising for the client, > right? Is there any legitimate reason we should take locks out of row key > sorted order because the client has structured the request as such? -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Updated] (HBASE-17924) Consider sorting the row order when processing multi() ops before taking rowlocks
[ https://issues.apache.org/jira/browse/HBASE-17924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Purtell updated HBASE-17924: --- Description: When processing a batch mutation, we take row locks in whatever order the mutations were added to the multi op by the client. {noformat} RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks {noformat} Or {noformat} RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> HRegion#get | HRegion#append | HRegion#increment | HRegionServer#doBatchOp -> HRegion#batchMutate -> HRegion#doMiniBatchMutation {noformat} multi() is fed by client APIs that accept a RowMutations object containing actions for multiple rows. The container for ops inside RowMutations is an ArrayList, which doesn't change the ordering of objects added to it. We should discuss sorting the order of ops by row key when processing multi() ops before taking row locks. Does this make lock ordering more predictable for server side operations? Yes, but potentially surprising for the client, right? Is there any legitimate reason we should take locks out of row key sorted order because the client has structured the request as such? was: When processing a batch mutation, we take row locks in doMiniBatchMutation in whatever order the mutations were added to the multi op by the client. {noformat} RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks {noformat} Or {noformat} RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> HRegion#get | HRegion#append | HRegion#increment | HRegionServer#doBatchOp -> HRegion#batchMutate -> HRegion#doMiniBatchMutation {noformat} multi() is fed by client APIs that accept a RowMutations object containing actions for multiple rows. The container for ops inside RowMutations is an ArrayList, which doesn't change the ordering of objects added to it. We should discuss sorting the order of ops by row key when processing multi() ops before taking row locks. Does this make lock ordering more predictable for server side operations? Yes, but potentially surprising for the client, right? Is there any legitimate reason we should take locks out of row key sorted order because the client has structured the request as such? > Consider sorting the row order when processing multi() ops before taking > rowlocks > - > > Key: HBASE-17924 > URL: https://issues.apache.org/jira/browse/HBASE-17924 > Project: HBase > Issue Type: Improvement >Reporter: Andrew Purtell > > When processing a batch mutation, we take row locks in whatever order the > mutations were added to the multi op by the client. > > {noformat} > RSRpcServices#multi -> RSRpcServices#mutateRows -> HRegion#mutateRow -> > HRegion#mutateRowsWithLocks -> HRegion#processRowsWithLocks > {noformat} > Or > {noformat} > RSRpcServices#multi -> RSRpcServices#doNonAtomicRegionMutation -> > HRegion#get > | HRegion#append > | HRegion#increment > | HRegionServer#doBatchOp -> HRegion#batchMutate -> > HRegion#doMiniBatchMutation > {noformat} > > multi() is fed by client APIs that accept a RowMutations object containing > actions for multiple rows. The container for ops inside RowMutations is an > ArrayList, which doesn't change the ordering of objects added to it. > We should discuss sorting the order of ops by row key when processing multi() > ops before taking row locks. Does this make lock ordering more predictable > for server side operations? Yes, but potentially surprising for the client, > right? Is there any legitimate reason we should take locks out of row key > sorted order because the client has structured the request as such? -- This message was sent by Atlassian JIRA (v6.3.15#6346)