You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/03/01 01:37:08 UTC
[GitHub] [ignite] isapego opened a new pull request #8836: IGNITE-14204 Fix C++ thin transactions
isapego opened a new pull request #8836:
URL: https://github.com/apache/ignite/pull/8836
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
### The Contribution Checklist
- [ ] There is a single JIRA ticket related to the pull request.
- [ ] The web-link to the pull request is attached to the JIRA ticket.
- [ ] The JIRA ticket has the _Patch Available_ state.
- [ ] The pull request body describes changes that have been made.
The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
- [ ] The pull request title is treated as the final commit message.
The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
- [ ] A reviewer has been mentioned through the JIRA comments
(see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
- [ ] The pull request has been checked by the Teamcity Bot and
the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
### Notes
- [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
- [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
- [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
- [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
----------------------------------------------------------------
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
[GitHub] [ignite] isapego commented on a change in pull request #8836: IGNITE-14204 Fix C++ thin transactions
Posted by GitBox <gi...@apache.org>.
isapego commented on a change in pull request #8836:
URL: https://github.com/apache/ignite/pull/8836#discussion_r584548610
##########
File path: modules/platforms/cpp/thin-client/CMakeLists.txt
##########
@@ -34,6 +34,7 @@ set(SOURCES src/impl/data_channel.cpp
src/impl/message.cpp
src/impl/cache/cache_client_proxy.cpp
src/impl/cache/cache_client_impl.cpp
+ src/impl/transactions/transaction_impl.cpp
Review comment:
Fixed.
----------------------------------------------------------------
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
[GitHub] [ignite] ptupitsyn commented on a change in pull request #8836: IGNITE-14204 Fix C++ thin transactions
Posted by GitBox <gi...@apache.org>.
ptupitsyn commented on a change in pull request #8836:
URL: https://github.com/apache/ignite/pull/8836#discussion_r584482528
##########
File path: modules/platforms/cpp/thin-client/src/impl/cache/cache_client_impl.cpp
##########
@@ -101,274 +101,238 @@ namespace ignite
return channel;
}
- template<typename ReqT>
- void CacheClientImpl::checkTransactional(ReqT& req)
+ template<typename ReqT, typename RspT>
+ bool CacheClientImpl::TryProcessTransactional(ReqT& req, RspT& rsp)
{
- SP_TransactionImpl activeTx = tx.Get()->GetCurrent();
+ TransactionImpl* activeTx = tx.Get()->GetCurrent().Get();
+
+ if (!activeTx)
+ return false;
- bool isUnderTx = activeTx.IsValid();
+ req.activeTx(true, activeTx->TxId());
- int32_t txId = isUnderTx ? activeTx.Get()->TxId() : 0;
+ SP_DataChannel channel = activeTx->GetChannel();
- req.activeTx(isUnderTx, txId);
+ channel.Get()->SyncMessage(req, rsp, router.Get()->GetIoTimeout());
+
+ if (rsp.GetStatus() != ResponseStatus::SUCCESS)
+ throw IgniteError(IgniteError::IGNITE_ERR_CACHE, rsp.GetError().c_str());
+
+ return true;
}
void CacheClientImpl::Put(const WritableKey& key, const Writable& value)
{
Cache2ValueRequest<RequestType::CACHE_PUT> req(id, binary, key, value);
-
- checkTransactional(req);
-
Response rsp;
- SyncCacheKeyMessage(key, req, rsp);
+ if (!TryProcessTransactional(req, rsp))
Review comment:
The condition `if (!TryProcessTransactional(...)) SyncCacheKeyMessage(...)` is duplicated a lot, I think we can move this logic into `SyncCacheKeyMessage` / `SyncMessage`. Should be less error-prone as well if we add new operations.
##########
File path: modules/platforms/cpp/thin-client/CMakeLists.txt
##########
@@ -34,6 +34,7 @@ set(SOURCES src/impl/data_channel.cpp
src/impl/message.cpp
src/impl/cache/cache_client_proxy.cpp
src/impl/cache/cache_client_impl.cpp
+ src/impl/transactions/transaction_impl.cpp
Review comment:
Nitpick: indent, tabs vs spaces?
----------------------------------------------------------------
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
[GitHub] [ignite] asfgit closed pull request #8836: IGNITE-14204 Fix C++ thin transactions
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #8836:
URL: https://github.com/apache/ignite/pull/8836
----------------------------------------------------------------
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