Sunday, November 03, 2013

4GL and threads / 4GL e threads

This article is written in English and Portuguese (original is here)
Este artigo está escrito em Inglês e Português (o origianl está aqui)


English version:

Introduction

Back to a real life situation, this time with 4GL. It has some technical details that are interesting, and it's also a good example of how to debug and solve a problem (modesty apart, but as you'll see the merit is not even mine - several people contributed to this - ). It's also a perfect example of how technical support tends to work these days, and as I usually say, customers receive what they demand (less quality and less availability to help). Again, IBM technical support stood up from other companies. And yes, I'm biased, but along the article I'll show you the differences and you can judge for yourself.
I'm presenting this as a warning to any customer wanting to do something similar (which is not supported, so should be avoided) and as a possible workaround if you already did it, and face the same issues.
I will not mention other vendor's names,as I will criticize their support, and for that I will have to blur some details. Hopefully it will not prevent the understanding of the problem.

Problem description

4GL is a programming language which we can integrate with other components through the usage of C language functions. 4GL is not supposed to be thread safe. Threads can be seen as parallel or concurrent programming aids. They can more or less act as a process, but are lighter and because of that they're used in many situations. However, because a process can run several threads, they all share common address space and the operating systems don't isolate them as they do with processes (in fact, if they did, threads would loose several of their advantages). This can have bad consequences. We must be very carefully when working with a threaded programming model, because one thread can overwrite data used by other threads and this can lead to all kinds of problems. There are several techniques to achieve thread safety like code re-entrance, mutual exclusion, using local instead of global variables etc. For the record, a thread has a private stack and the context of the thread and some local variables can be stored there. So, each thread's stack should be "sacred" ground, not to be invaded by others.
Saying 4GL is not thread safe means that the internal 4GL code was not implemented with the above concepts in mind. It depends on global variables for example. But it can also do "nasty" things that affect other threads on the same process, even when those threads are not running 4GL functions and code.
In my situation, a customer linked a 4GL application with a third-party library (middleware software) that internally uses threads (it creates one thread to be exact). That library allows the 4GL application to extract/request data from other systems. It's important to note that this was done years ago (5-10 years) and it's been working without anybody noticing any issue. At some point, due to a system overload, customer decided to move a group of users to another system, running the same versions of OS, 4GL and third party integration software. Initially a few small differences between the systems were spotted, but after being eliminated the problem still persisted. On the "new" systems (in fact they're relatively old systems, running out of regular support), users started to experience a lot of application crashes. A core dump was generated and it was reported to me for analysis.
I've been working with 4GL since 1991 (wow... 22 years!), first as a programmer and after I joined Informix (1998) as a consultant, so I'd say I have a large experience with the language (although nowadays I honestly feel a  bit rusty because I don't do 4GL every day). But what I'm trying to say is that it's obviously not the first time I see a 4GL core. Typically they're caused by exceeding the array limits or because a C function with some problem was linked with the main process, or very rarely by a bug. So I usually start with a debugger (dbx for example) to extract the core's stack trace. It usually tells us where the problem happened, and we can then do some code analysis. Another option is to recompile all the modules with "-a" flag of c4gl command. It includes some array protection code that will force the program to stop if an invalid array position is used. This can slow the program, but it's a pretty good way to catch array dimensioning issues.
In this particular case, the stack trace was nearly useless because it looked "corrupted", and it only showed operating system functions related to exception handling. Meaning the OS perceived something was wrong, but while trying to generate the core it got confused. The -a option was used without success.. The crashes seem to be relatively random, in different parts of the code or user options.
A more empirical approach was followed. We picked a program that crashed frequently in some option and tried to strip it out of as many things as we could. We ended up with a much more simple test case that we could use to reproduce the crash. After a few repetitions of doing the same thing we usually got the core. We understood that the crash typically happened around reading a key. The first suspect we had was 4GL... There is a documented potential issue when some input structures (INPUT, PROMPT, MENU etc.) are used inside a loop and we exit the loop without EXITing the input structure properly. Mainly because of this (the test code resembled a brief description of the issue), we opened a PMR with IBM. That was the first time we got in touch with any of the vendors involved (IBM for 4GL, one for the OS and another for the third party library). After a bit of investigation we cleared this possibility. IBM technical support was helpful in understanding some details we gathered with a debugger. But for a while we were a bit stuck. I must explain that by then, there were three people deeply involved in this situation: I was trying a more "practical" approach to isolate the problem by changing and trying to simplify the test case; A colleague from IBM technical support who was trying to check similar issues already reported, and helping with our doubts, as he is more knowledgeable in debugging techniques; A customer team member who was trying the "scientific" approach. He spent hours running the test case on a debugger and he even looked at the assembler (and believe me, you'll never be the same after trying to understand the assembler of this old, poorly documented and complex platform).
I managed to confirm that if the application didn't call the third party function it wouldn't happen. Taking a closer look at the code that glue 4GL with the third party system I've found several problems, but fixing them didn't help. And I was getting stuck. But the customer noticed that a certain behavior in the thread status seemed to happen just before the crash. He was almost sure that the threads and/or thread management had something to do with it. With this findings in mind we noticed that on the core dump, the functions from the third party library seemed to vanish from the status of the process after the crash. So I changed the 4GL investigations from user input structures and the like to issues around threads. Needless to say neither me or my colleague could find too many situations, because 4GL is not thread safe... so people usually don't use threads. But we've been able to find a few reports:
  1. One on the same platform as our situation. But the customer had the option to link with a non threaded library, so the problem was solved without further investigation
  2. A very similar problem, related to keyboard reading, on AIX. Some OS parameters controlling thread scheduling were changed and the problem disappeared
  3. A not very well documented issue on Solaris where some workaround was implemented by IBM, but not included in the mainstream code.
It's important to recall that we had two systems where this happened and several where we could not reproduce it. The systems looked similar and the customer system administrators couldn't find any reason why the application crashed on some, but not on most of their systems. After some insistence they agreed to open a case on their operating system supplier. I explained we were looking for help in debugging the issue and that we had no indication that the cause was in the operating system.
A sort of conference call with the possibility of desktop sharing was scheduled and I showed the problem happening. During the core some cryptic message was shown... as soon as the engineer saw the message (something like "unable to unwind stack") she wrote: "That's an application issue!"... Well... Yes.. In theory I could agree with that. But it didn't help us. It didn't explain why it only happened in this system. It also didn't explain why the OS couldn't generate a "clean" core that was helpful for us... After a bit of talk, and after I insisted that what we were looking for was some more deep knowledge on the OS debugging tools and outputs, another engineer joined the call. He was much more willing to help, although at the time no magic was done...
They agreed about investigating some points I raised regarding OS behavior and thread signal handling (referenced in other IBM PMRs), and we proceed with IBM investigation and test case elaboration.

At this point the status was:
1- We were almost sure it had to do with threads (thanks to the customer team member) that allowed us to find a useful old PMR
2- We were puzzled by the fact that the same code behaved differently on different systems and asked OS supplier to help us with that
3- Since 4GL was not meant to work in a multi-thread environment we tried to verify if there was some configuration related to the third-party library that would allow us to avoid thread creation

The OS support got back to us with some more vague details, but nothing that would allow us to change thread scheduling behavior (like it was done for AIX). They couldn't also explain why it happened on some systems and not on others.
Meanwhile we got interested in the way 4GL deals with signal handling. We started to suspect that 4GL was setting up some signal handlers and that one (or more) was being executed in the context of the thread created by the library.

Given 3) above I suggested that we get more involvement of the customer team managing the third party integration tool. But because they were not able to give us any answers, we decided to open a case with their supplier's support. The questions were:
1- Is there a way to avoid the thread creation?
2- If not, is there any way to control the time it stays "idle" (we noticed the thread was mostly idle, but it was waking at regular intervals)
3- Was there any way to control the signals it would respond to?

There was just one answer, and it was staggering simple: "Sorry Mr. customer. You're using an out of support version. Please upgrade before asking any questions"
Don't get me wrong... I do understand and even sympathize with lack of support for very old software versions. But we were not asking for any code debuging, or code change. And the questions would probably be valid if it was a supported version (as per their manual, the same function interfaces were still in use in recent versions). So this answer was a bit strong. I've seen much worse situations being answered by IBM Informix support. But customer accepted it, so I couldn't do anything about it.
Basically we were a bit stuck... not much help from other tech supports.. Our technical support suggested that when reading the keyboard, 4GL was doing something to handle the special key "ESCAPE" that could cause troubles.... Very shortly, the "escape" code can mean the escape key or the beginning of an escape sequence (used in terminal emulators). So it does a "read()" and gets the escape code. After that it has a dilemma: If it's an escape sequence (starts with the escape code) the program has to read() again. But if it was just the escape key the call to read() will block. 4GL solves this by calling "alarm()" and then read() again. The alarm() call will trigger a signal (ALRM) to be sent to the process after the specified time. If by then the read() is still active, the alarm signal handler (setup by 4GL) will cancel the call and proceed. This is done by manipulating the current stack. It's a dirty trick, but it is, or at least was common a few years ago. We were able to find discussions about Apache issues because it uses the same concept (naturally not for keyboard reading).
With this in mind we decided to try a workaround by changing the 4GL internal code. I was impressed by technical support ability and willingness to try this. The mechanism above was changed for another method that avoided the second call to read() (blocking). A non blocking method was used and they created a patch (non-official). This was put into place and the program stopped crashing on that specific point. That was the good news. The bad was that it kept crashing on other places, and assuming it was caused by the signal handling outside of the 4GL thread context, it would not be possible to change it without major changes in the 4GL internal code. And it was clear that it would be very difficult to implement those, and R&D would not see that as a real possibility.

The solution

That was when a more pragmatic approach was taken. System documentation tells us that a thread B created by thread A will inherit the "signal mask" of A. The signal mask is a bit array where each bit matches a specific signal and if it's on/off the signal will/won't be received by the thread. As we don't want the third party thread to receive the signals for which 4GL sets up handlers, we can change the signal mask just before creating that thread, and restoring the initial one just after the thread creation.
IBM technical support agreed this was worth trying and provided a list of possible signals to mask.

Technically, doing this is terribly simple:

#include <sys/types.h>
#include <errno.h>
#include <signal.h>

[…]

sigset_t mask, orig_mask;


sigemptyset (&mask);  /* creates and empty mask */

/* Now let's add a few signals to the mask. Others could be considered like SIGTERM) */ 
sigaddset (&mask, SIGALRM);
sigaddset (&mask, SIGINT);
sigaddset (&mask, SIGQUIT);

/* Now use the mask prepared above to as a "blocking" mask. At the same time, the current mask is saved in orig_mask variable */ 





if ( pthread_sigmask(SIG_BLOCK, &mask, &orig_mask) != 0 ) {
     /* Handle any possible error... *//
}

/*
      Call the function that creates the thread in the third party library
*/

/* And now restore the original mask, saved in orig_mask variable */
if ( pthread_sigmask(SIG_SETMASK, &orig_mask, NULL) != 0 ) {
     /* Handle any possible error */
}

Conclusion

After applying the code above to the customer application, the problem didn't show up again. Since we're blocking the "dangerous" signals before we create the new thread, it will inherit this blocking. And after we block those signals, the handlers setup by 4GL code will not be called in the context of the "foreign" thread. They'll be run only when the context belongs to the 4GL thread.
This means the "nasty" things 4GL does to it's own stack will not ever affect the other thread(s) stack.

I'd like to point out the difference between technical support services: IBM provided a trial patch to "fix" something that works as design. Another company declined to answer some questions because we mentioned an unsupported version, although the questions were valid for currently supported versions. And another one could not explain the difference between their systems, and only after my insistence they managed to provide some details (that were not very helpful, but I grant that because the problem was not on their side this could be reasonable)

The final important note: This is a "trick". 4GL is inherently not thread safe and you shouldn't assume otherwise. But there is a difference between not being able to run two 4GL threads in the same process and having a 4GL thread with one or more non 4GL threads. You can still have problems, and this workaround may not be usable in some cases, but it can be a simple way out if you're already in the hole (like if you have been using threads inside a 4GL process and somehow things start to fail). If you're not in that hole yet, be advised not to enter it!

For some more technical details about this issue you can check the following IBM tech note:

http://www-01.ibm.com/support/docview.wss?uid=swg21642635

To grant the credits to those who deserve it, the progress on this issue would not have been possible without Rui Mourão (from the customer team) and IBM's technical support colleague Alberto Bortolan


Versão Portuguesa:

Introducão

De volta a uma situação real, desta feita com 4GL. Tem alguns detalhes técnicos interessantes, e é também um bom exemplo de como fazer debug e resolver um problema (modéstia à parte, mas como verá o mérito não é meu - várias pessoas contribuíram para isto - ). É também um exemplo perfeito de como os suportes técnicos tendem a trabalhar atualmente, e como costumo dizer, os clientes recebem aquilo que exigem (menor qualidade e menos disponibilidade para ajudar). E novamente o suporte técnico da IBM distinguiu-se de outros. E sim, sou suspeito, mas ao longo do artigo mostrarei as diferenças e poderá julgar por si mesmo.
Estou a apresentar isto como um aviso para qualquer cliente que pense em fazer algo semelhante (que não é suportado e portanto deve ser evitado), e como possível forma de contornar o problema, caso já o tenha feito e tenha os mesmos problemas.
Não mencionarei os nomes dos outros fornecedores, visto que os irei criticar pelo suporte prestado. Devido a isso terei de mascarar alguns detalhes. Espero que isso não impeça o entendimento do problema

Descrição do problema

O 4GL é uma linguagem de programação que pode ser integrada com outros componentes através da utilização de funções em linguagem C. O 4GL não é suposto ser "thread safe". As threads podem ser vistas como auxiliares de programação concorrente. De certa forma atuam como processos, mas são mais leves e devido a isso são usadas em muitas situações. No entanto, porque um processo pode correr várias threads,  todas elas partilham um espaço de endereçamento comum e os sistemas operativos não as isolam como aos processos (na verdade, se o fizessem perdiam-se as maiores vantagens que têm). Isto pode ter más consequências. Temos de ter muito cuidado ao trabalhar num modelo de programação com threads, pois uma thread pode re-escrever dados usados por outra(s) thread(s) e isto pode dar origem a problemas muito variados. Existem várias técnicas para obter segurança na gestão das threads como código re-entrant, exclusão mútua, usar variáveis locais em vez de globais etc. Para que conste, uma thread tem um stack próprio onde é guardado o contexto da thread e algumas variáveis locais por exemplo. O stack de cada thread deve ser considerado "solo sagrado" não devendo ser "invadido" por outra(s) thread(s).
Dizer que o 4GL não é thread safe significa que o código interno do 4GL não foi implementado com os conceitos anteriores em mente. Depende de variáveis globais por exemplo. Mas também pode fazer "maldades" que afetam outras threads dentro do mesmo processo, mesmo quando essas threads não executam funções e/ou código 4GL.
Nesta situação, o cliente tinha linkado uma aplicação 4GL com uma biblioteca de terceiros (software de middleware) que internamente usa threads (cria uma thread para ser exato). Essa biblioteca permite ao 4GL interagir (extraindo ou requisitando dados) com sistemas externos. É importante notar que isto foi feito há 5-10 anos atrás e tem funcionado sem que ninguém se apercebesse de qualquer problema. Em dado momento, devido a sobrecarga num sistema, o cliente decidiu distribuir alguns utilizadores para outro sistema, configurado com as mesmas versões de SO, 4GL e da biblioteca de integração. Ao início detetaram-se diferenças mínimas entre os sistemas, mas depois de eliminadas o problema persistiu. Nos sistemas "novos" (na realidade são sistemas antigos que estão já sem novos desenvolvimentos e em fim de vida) os utilizadores começaram a sentir inúmeros crashes nas aplicações. Core dumps eram gerados e foram-me reportados para análise.
Tenho trabalhado com o 4GL desde 1991 (ena... 22 anos!), primeiro como programador e depois de ter entrado na Infomix (1998) como consultor, portanto diria que tenho uma vasta experiência com a linguagem (apesar de atualmente, honestamente me sentir "enferrujado" porque não trabalho com o produto todos os dias). Mas o que estou a tentar dizer é que obviamente esta não é a primeira vez que vejo um core no 4GL. Tipicamente são causados por exceder-mos os limites dos arrays, ou porque alguma função em C com algum problema foi linkada com a aplicação, ou muito raramente devido a algum bug. Portanto, normalmente começo com um debugger (dbx por exemplo) para extrair o stack trace. Normalmente isto diz-nos onde é que o problema aconteceu  e isso permite-nos fazer alguma análise de código. Outra opção é recompilar os módulos com a opção "-a" do comando c4gl. Isto inclui algum código de proteção aos limites dos arrays que obriga o programa a abortar se os mesmos forem excedidos. Isto teoricamente pode abrandar o programa, mas é uma excelente forma de apanhar problemas de dimensionamento de arrays.
Neste caso particular, o stack trace não era muito útil, pois parecia "corrompido", e apenas mostrava funções de sistema operativo relacionadas com gestão de exceções. Significava isto que o SO se apercebia que algo tinha corrido mal, mas durante a geração do core ficava confuso. A opção "-a" foi usada, mas sem sucesso. Os crashes pareciam relativamente aleatórios, ocorrendo em diferentes zonas do código e diferentes opções do utilizador.
Foi seguida uma abordagem mais empírica. Pegámos num programa que gerava cores frequentemente numa determinada opção e tentámos simplificá-lo ao máximo. Acabámos por chegar a um caso de teste muito mais simples que conseguíamos usar para reproduzir o problema. Depois de algumas repetições da mesma operação obtínhamos o crash. E tipicamente o problema aparecia em torno da leitura de uma tecla. O primeiro suspeito que tivemos foi o 4GL... existe documentação sobre um potencial problema quando algumas estruturas de input (INPUT, PROMPT, MENU etc.) são usadas dentro de um ciclo e saímos do mesmo sem sair da estrutura devidamente. Essencialmente devido a isto (o código de teste assemelhava-se a uma descrição do problema) decidimos abrir um PMR  na IBM. Foi a primeira interação com qualquer dos suportes técnicos dos vendedores envolvidos (IBM pelo 4GL; um para o SO e outro para a biblioteca de integração). Após alguma investigação descartámos esta hipótese. O suporte técnico da IBM foi útil para entendermos alguns detalhes que reunimos com o debugger. Mas durante um curto perído estávamos bloqueados. Devo explicar que por esta altura éramos três pessoas bastante envolvidas no assunto: Eu estava a tentar seguir uma abordagem prática para isolar o problema tentando alterar o caso de teste e simplificá-lo; Um colega do suporte técnico da IBM que estava a tentar encontrar situações semelhantes já reportadas e nos dava suporte em dúvidas várias visto ser muito mais conhecedor de debuggers; Um membro da equipa do cliente que estava a seguir a abordagem mais "científica". Passou horas a tentar executar o processo num debugger e chegou mesmo a analisar o assembler (e acreditem-me que ninguém se mantém inalterado depois de tentar entender o assembler de uma plataforma complexa, antiga e mal documentada)
Pela minha parte consegui confirmar que se a aplicação não chamasse a biblioteca de integração o problema não acontecia. A verificação do código que "colava" o 4GL a essa biblioteca permitiu identificar vários problemas, mas mesmo depois de corrigidos, o problema mantinha-se. Eu estava a ficar sem opções... Mas o cliente notou que parecia haver uma alteração de comportamento nas threads mesmo antes de o core ser gerado. Ele estava plenamente convencido que as threads ou a gestão das mesmas estavam diretamente relacionados com o problema. Com estes dados em mente, notámos que as funções da biblioteca de integração pareciam "desaparecer" do stack trace do processo após o crash. Assim, mudámos a investigação das estruturas do 4GL para problemas com threads. Escusado será dizer que nem eu nem o colega da IBM conseguimos encontrar muitas situações, pois como o 4GL não é thread safe não há muitas pessoas a usá-lo com threads. Mas conseguimos encontrar alguns relatos:
  1. Uma ocorrência na mesma plataforma que o nosso caso. Mas o cliente tinha a opção de linkar com uma biblioteca que não usava threads e o problema foi fechado sem mais investigação
  2. Um problema semelhante, relacionado com a leitura de teclado, mas em AIX. Foram mudados alguns parâmetros que controlam o thread scheduling e o problema desapareceu
  3. Um problema não muito bem documentado, em Solaris. Terá sido fornecido um workaround pela IBM sob a forma de patch específico
É importante recordar que tínhamos dois sistemas onde isto acontecia e outros onde não era possível reproduzir. Os sistemas pareciam semelhantes e os administradores de sistema não encontravam explicação para a diferença de comportamentos. Após alguma insistência concordaram em abrir um caso no suporte do sistema operativo. Expliquei que procurávamos ajuda para fazer o debug e que não tínhamos indicação nenhuma que a origem do problema fosse no SO. Uma espécie de conferência com possibilidade de partilha do desktop foi agendada e demonstrei o problema a acontecer. Durante a geração do core uma mensagem pouco clara (algo como "unable to unwind the stack") era mostrada... e assim que a pessoa do suporte a viu escreveu: "Isso é um problema aplicacional!"... Bom... Sim... Em teoria podia concordar com isso. Mas tal não nos ajudava. E não explicava porque só acontecia em alguns sistemas E não explicava porque é que o SO não gerava um core "limpo"... Depois de mais alguma conversa, e depois de reforçar que o que procurávamos era um conhecimento mais profundo nas ferramentas de debug do SO, e na interpretação dos outputs, um outro elemento do suporte juntou-se á conferência. Era claramente mais experiente e tinha outra atitude, muito mais disposta a ajudar, mas apesar disso, durante a conferência não se fez magia...
Concordaram em investigar alguns pontos que levantei sobre o comportamento do SO e na gestão de sinais (referido nos outros PMRs na IBM), e prosseguimos com a investigação pela IBM e continuamos a elaboração do caso de teste.
Nesta altura o ponto de situação era:
  1. Estávamos quase certos que o problema estava relacionado com threads (graças ao elemento da equipa do cliente que nos permitiu encontrar algo relevante na base de dados de casos da IBM)
  2. Estávamos intrigados pelo facto de o mesmo código ter comportamentos diferentes em sistemas diferentes. Daí o pedido de ajuda ao suporte do SO
  3. Dado que o 4GL não foi pensado para correr num ambiente de múltiplas threads, tentámos verificar se haveria alguma configuração da biblioteca de integração que permitisse fazer as mesmas operações, mas sem criar nova thread
O suporte do SO voltou a contactar-nos com alguns detalhes algo vagos. mas nada que nos permitisse modificar o comportamento do scheduling das threads (como teria sido feito no caso em AIX). E não conseguiam uma explicação sobre porque só acontecia em alguns sistemas.
Entretanto ficámos interessados na forma como o 4GL trabalha com os handlers  de sinais. Começamos a suspeitar que o 4GL estava a posicionar alguns handlers de sinais e que um (ou mais) estava a ser executado no contexto da thread criada pela biblioteca.

Dado o 3) acima, sugeri que obtivéssemos mais envolvimento da equipa que gere a biblioteca. Mas como não nos conseguiram dar grandes respostas, decidimos abrir um caso no suporte do fornecedor da biblioteca. As questões eram:
  1. Há alguma forma de evitar a criação da thread?
  2. Senão, há alguma forma de controlar o tempo que permanece idle (notámos que a thread passava a maior parte do tempo idle e que era acordada a intervalos regulares)
  3. Haveria alguma forma de controlar os sinais aos quais a thread poderia responder?

Houve apenas uma resposta, e foi desconcertante: "Desculpe Sr. cliente. Está a usar uma versão sem suporte. Por favor atualize a versão antes de fazer qualquer pergunta".
Não me interprete mal... Entendo e concordo com o fim de suporte para versões muito antigas. Mas não estávamos a pedir análise de código, debug ou alterações ao mesmo. E as questões (segundo o manual da versão atual as mesmas funções ainda existiam) seriam válidas para as versões correntes do produto. Portanto  a resposta pareceu um pouco forte. Já presenciei situações muito piores serem atendidas pelo suporte IBM Informix. Mas o cliente aceitou a resposta, portanto não podia fazer nada sobre isso. Voltámos novamente a estar um pouco encravados... Sem muita ajuda de outros suportes técnicos. O nosso suporte técnico sugeriu que o 4GL, ao ler o teclado, estava a fazer algo para lidar com a tecla especial "ESCAPE" que poderia causar problemas... De forma muito resumida, o código de "escape" pode ser a tecla de "ESCAPE" ou o inicio daquilo que se designa por sequência de escape (usadas em emuladores de terminais). O código faz uma chamada à função read() e obtém o código de escape. E isso coloca-o num dilema: Se é uma sequência de escape (começa com o código de escape) o programa tem de voltar a ler (nova chamada read()). Mas se era apenas o código da tecla, esta nova chamada vai bloquear (pois não há nada para ler). A forma como o 4GL resolve isto é chamar a função alarm() e depois o segundo read(). A chamada a alarm() despoleta um sinal (ALRM) a ser enviado ao processo ao fim do tempo especificado na chamada. Se nessa altura o read() ainda estiver pendente, o handler do sinal (estabelecido pelo 4GL) irá cancelar a chamada e prosseguir com a execução normal. Isto é possível manipulando o stack. É um truque "feio", mas é, ou pelo menos foi comum há alguns anos atrás. Conseguimos encontrar discussões sobre problemas no Apache porque utiliza o mesmo conceito (naturalmente não para ler o teclado).
Com isto em mente, decidimos tentar um workaround mudando o código interno do 4GL. Fiquei impressionado com a capacidade e a vontade do suporte técnico em tentar isto. O mecanismo anterior foi modificado para outro método que evita a segunda chamada ao read() (a que bloqueava). Uma chamada não bloqueante foi usada e criaram um patch não oficial para teste. Este foi colocado no ambiente do cliente e o programa deixou de crashar naquele ponto específico. Isto foram as boas notícias. As más é que começamos a ter outros crashes noutros pontos, e assumindo que estes eram ainda causados pela execução de handlers de sinais fora do contexto da thread do 4GL, não seria possível alterar isso sem efetuar mudanças estruturais ao código interno do 4GL. E era claro que seria difícil fazer essa implementação e em princípio o desenvolvimento da IBM não veria isso como uma possibilidade viável.

A solução

Foi então que uma abordagem mais pragmática foi assumida. A documentação de sistema diz-nos que uma thread B criada por uma thread A, herda a "signal mask" da A. A "signal mask" é um array de bits onde cada um representa um sinal específico, e se estiver on/off o sinal será/não será recebido pela thread. Como não queremos que a thread criada pelo software de integração receba sinais para os quais o 4GL preparou handlers, podemos mudar a máscara imediatamente antes de criar a thread, e restaurar a inicial imediatamente depois de criar a thread.
O suporte técnico da IBM concordou que valeria a pena testar isto e forneceu uma lista de sinais que valia a pena impedir.
Tecnicamente, fazer isto é muito simples:

#include <sys/types.h>
#include <errno.h>
#include <signal.h>

[…]

sigset_t mask, orig_mask;


sigemptyset (&mask);  /* cria uma máscara vazia */

/* Agora vamos adicionar alguns sinais à máscara. Outros poderiam ser considerados como o SIGTERM) */ 
sigaddset (&mask, SIGALRM);
sigaddset (&mask, SIGINT);
sigaddset (&mask, SIGQUIT);

/* Agora usamos a máscara que preparámos antes como uma máscara de bloqueio. Ao mesmo tempo a máscara actual é salvaguardada na variável orig_mask */ 





if ( pthread_sigmask(SIG_BLOCK, &mask, &orig_mask) != 0 ) {
     /* Lidar com qualquer possível erro.. *//
}

/*
     Chamar a função que cria a thread na biblioteca de integração
*/

/* E agora restaurar a máscara original, entretanto slavguardada na variável orig_mask */
if ( pthread_sigmask(SIG_SETMASK, &orig_mask, NULL) != 0 ) {
     /* Lidar com qualquer possível erro */
}

Conclusão

Após aplicar a alteração explicada acima na aplicação do cliente, o problema não se voltou a verificar. Como estamos a bloquear sinais "perigosos" antes de criarmos a nova thread, esta irá herdar esse bloqueio. Depois disso os handlers ativados pelo código 4GL não serão chamados no contexto da thread "externa". Apenas serão executados quando o contexto corrente pertence à thread de 4GL.
Isto quer dizer que as coisas "más" que o 4GL faz ao seu próprio stack nunca irão afetar o stack da(s) outra(s) thread(s).

Gostaria de salientar a diferença que verifiquei entre os serviços de suporte técnico: A IBM providenciou um patch de teste para "corrigir" algo que funciona como foi desenhado. Outra companhia declinou responder a algumas questões porque mencionámos uma versão fora de suporte, ainda que as questões fossem válidas para as versões que estão suportadas. E outra companhia não pôde explicar as diferenças de comportamento entre sistemas, e apenas depois da minha insistência foram capazes de providenciar alguns detalhes (que não foram muito úteis, mas compreendo que dado o problema não estar do lado deles isto poderá ser visto como razoável).

Uma nota final importante. Isto é um truque. O 4GL não é, nunca foi e provavelmente nunca será thread safe. Mas existe uma diferença entre não ser possível correr duas threads "4GL" no mesmo processo e ter uma thread 4GL com uma ou mais threads não 4GL. Pode mesmo assim haver problemas e esta solução poderá não ser viável em alguns casos, mas pode ser uma saída se já se encontrar no "buraco" (caso já venha a usar threads dentro de processos 4GL e de repente as coisas começarem a falhar). Se ainda não está nesse buraco, fica o aviso para não se deixar arrastar para ele!

Para mais detalhes técnicos sobre este problema pode consultar a seguinte nota técnica da IBM:

http://www-01.ibm.com/support/docview.wss?uid=swg21642635

Para dar o crédito a quem o merece, a evolução deste problema só foi possível graças à participação do Rui Mourão (pelo cliente) e do colega do suporte técnico da IBM Alberto Bortolan

Saturday, October 26, 2013

IBM IOD 2013: Informix sessions

This article is written only in English (original post here)

If you're interested in Informix and will be present at 2013 IBM IOD (Information On Demand) conference in Las Vegas, 3-7 November, you can find your complete list of Informix related sessions in this URL:

https://www-950.ibm.com/events/global/iod/agendabuilder/preview.html?agendaid=495

Topics that will be covered include:

  • Latest V12.10 improvements
  • Timeseries
  • Warehouse Accelerator
  • NoSQL (MongoDB compatibility)
  • Genero
And although we usually say that what happens in Vegas stays in Vegas, that should not be the case with this conference. Either if you're there or not, check the conference website regularly for news, videos and so on. It contains easy links to social sites where you can also follow it:

http://www-01.ibm.com/software/data/2013-conference/

Wednesday, October 16, 2013

Informix 12.10.xC2: No(?)SQL?

This article is written in English and Portuguese (original article here)
Este artigo está escrito em Inglês e Português (artigo original aqui)



English version:

As usual lately, this article comes a bit late... But this time it was not just due to lack of time. I really hate to write about what I don't understand, and the new fixpack of Informix (12.10.xC2) is really about something I do not know: NoSQL functionality.
More specifically It's about the possibility to connect MongoDB applications (better saying, applications using MongoDB drivers and API) to Informix. In a previous article I wondered about this possibility and in fact it became available on September 13 (a Friday, so not all Fridays 13 bring bad things). As I mentioned, because I don't like to write about things I don't understand I spent some time these weeks trying to learn a bit more about it. Naturally it would be presumptuous from me to assume I'm now an expert on the subject, but at least I was able to read about it, try it and essentially think about it and discuss it with other people. In other words, I'm almost as ignorant as I was before, but I feel a lot more confident now :)
Before we dive into the feature list, as usual in my posts about new fixpacks, let me try to explain what is my current perception about this:
With the appearance of global sites, with millions of users, a need to scale emerged which goes beyond the normal perception of us, the IT staff in traditional business (local or international).
For things like Google, Twitter, Facebook and so on, the traditional relational repositories used in the traditional  ways, would not be able to provide the scalability, flexibility and response times needed. Does it mean they're not good? Not at all... It just means they were created to solve different challenges.
So a new breed of data repositories was developed. Lot's of new players like BigTable, MongoDB, Cassandra, Redis and many others. They are all called "NoSQL" systems, because they don't use or implement the SQL language. But the fact that they're generally referred to as NoSQL doesn't mean they're all alike. In fact they have significant differences between them that makes some good for some purpose and not good for other.They can be considered highly specialized data repositories. And of course, then there are some which are similar, but personal preferences lead to choosing one instead of other. Just like with traditional SQL databases.
But how are they different from the SQL databases? Well, essentially they don't implement a lot of things we consider as "granted". By doing so, they in a certain way assume some risks, but are able to provide simplicity and scalability beyond what we'd expect from "our" databases. A good reading regarding that is this article about Eric Brewer CAP theorem. I should also reference Ognjen Orel article about the new Informix release to point me to it. I do urge you to read both articles!
Some of these NoSQL databases also store data in a "document centric" way. MongoDB in particular stores a JSON (or BSON where B stands for binary) document as a "row". These documents don't need to have the same structure (even in the same "collection" which is the equivalent of a table) which makes schema change issues irrelevant. Another important point is that it doesn't allow joins. As you can see from the above article, most NoSQL databases are not ACID compliant. I suppose by now you're either very interested or shocked (or both). But these are just some of the things the new developers have given up to allow these repositories to scale beyond our general perception, and they do that horizontally, by dding nodes, usually implemented in the least expensive hardware (typically x86_64 based machines with some Linux flavor).

Now, this is relatively easy to understand, and you'll find a lot of information available to capture the details. The next step is to try to understand or figure out why and what kind of integration IBM have implemented. Is Informix going away from the SQL standard? Not at all! Will this allow it to scale horizontally as these solutions do? No, in my opinion of course. Will it allow Informix to compete with NoSQL solutions? Maybe in my opinion, in certain circumstances, but not at the "high level of scale" I mentioned before (Google, Twitter, Facebook etc.).
But I think the important point is slightly different. It's not as easy to find as the technical details and implementation decisions, but it you search carefully you'll find blog posts, opinions on forums etc. that defend that although NoSQL may be required to solve some issues, the same applications sometimes get over complicated because of the (assumed) lack of functionality. So, in those cases, it would be nice to have a "traditional" database providing the usual consistency, SQL ease of use and so on. It wouldn't mean the NoSQL was a bad choice, but that it would be nice to complement it with the "old" stuff. When we think about it, it makes sense. NoSQL became a requirement to solve a new challenge. By no means it's to be expected that for the same environments, the "traditional" problems don't exist. On the other hand, why not offer the MongoDB flexibility and ease of development within a traditional RDBMS? This is my personal perspective on the new features.

Features list

The complete feature list can be found here: http://pic.dhe.ibm.com/infocenter/informix/v121/topic/com.ibm.po.doc/new_features_ce.htm I will mention just a few (which I consider more important...).

  • Installation enhancements
    During the installation, if we decide to create an instance it will contain more auto-tunable features and will be ready for the JSON compatibility feature
  • Administration
    • New event alarm for network failures
      If the engine cannot start one of it's listeners a new alarm and an assert fail will be generated.
    • Back up and restore
      • Enhanced support for IBM Tivoli Storage Manager features
        Informix will allow bigger chunks of data to be sent between OnBAR and TSM (or PSM)
      • Restore critical files
        During the release day, I was just returning home from a foreign customer assignment where this was raised. Previously if you need to get the critical files from the storage manager you'd have to use filesystem backup interface or non documented features in OnBar. Now the documented syntax allows the user to retrieve the critical files from storage manager with an OnBAR option. This was required for PSM (Primary Storage Manager)
      • ON-Bar activity log timestamps
        More like a fix... Onbar would write the wrong timestamps in the log when it wrote messages stating it was stalled (waiting on storage manager XBSA library calls)
  • Performance
    • Faster operations
      • In-place alter operations on serial data types
        SERIAL to SERIAL8 and BIGINT to BIGINT8 becomes in-place alters
      • Faster queries for the Committed Read Last Committed isolation level
        Read ahead and light scans can now be used for this isolation level. I'm curious about the later...
    • Dynamic tuning
      • Dynamic private memory caches for CPU virtual processors
        VP_MEMORY_CACHE_KB will change dynamically to adapt to the system needs.
    • Troubleshooting
      • Monitor resource contention
        This will not raise Informix visibility or marketing recognition, but I believe it will be a favorite between existing users. It shows all the threads waiting on some condition together with information about the blocker. That information can include similar output to an onstat -g ses and the stack trace. Should be great to understand "hang" situations. I bet this was requested by tech support :)
  • Application development
    • JSON compatibility
      • JSON compatibility
        This is the core of this release. MongoDB applications (using MongoDB drivers) can connect to Informix and store and retrieve JSON/BSON documents, as well as get data stored in "native" Informix format in JSON format. It also includes the ability to use several Informix nodes in a way similar to how MongoDB uses nodes to split the records. This distributed capability is based on existing and new Informix Enterprise Replication features
      • JSON compatibility in OAT
        As usual, OAT allows some configuration on the new features
    • New syntax for queries
      • Joins with lateral references
        ANSI SQL compatibility feature for queries that use derived tables in the FROM clause
    • Enhanced basic text searching
      Several feature and performance enhancements for BTS datablade
    • Client products
      • IBM Informix .NET Provider support for .NET Framework versions
        Improved compatibility with newer .NET framework versions
    • New default
      • Defining separators for fractional seconds in date-time values
        I have a personal history with this one... Basically, in previous versions certain TO_CHAR and TO_DATE operations would force a "." (dot) to be included as the separator for fractions of a second. Now we can specify if we want it, or if we want a specific character. This was rather annoying because adding a character was easy, but removing the dot was impossible without nasty tricks
  • Enterprise Replication
    • Easier setup
      • Simplified schema changes for replicated tables
      • Set up and query time series data through a grid
    • Configuration
      • Control the replication of large objects
        We can force LOB columns to be replicated together with a row, even if it's content doesn't change
      • Custom checksum function for consistency checking
        A user can provide a checksum function to replace the default for consistency checking
    • Sharding
      • Shard tables across database servers
        Rows can be sent to different nodes based on hash or other expression to split data across a number of nodes (reducing the data volume in each node)
        The shard can define if the original row (on the original server) is kept after confirmation it was sent to destination, or deleted. So effectively you can distribute the data, without having to consider where (in which node) you insert it. And as we know, since 11.7 you can run a grid query that will retrieve the rows from all the relevant servers.
  • Time series data
    • Enhancements
      • Replicate time series data with all high-availability clusters
        Previously only HDR was supported. Now both SDS and RSS joined the party
      • Order TimeSeries columns in query results
      • Improvements for time series loader programs
        API enhancements
    • Faster queries
      • Faster aggregation of an interval of time series data
      • Faster queries on time series virtual tables
        Improvement for virtual tables based on fragmented TimeSeries tables
      • Accelerate queries on time series data
  • Warehousing
    • Additional types of data
      • Accelerate queries on time series data
      • Load data from external tables into data marts
 I hope to write some articles showing a bit more about this MongoDB compatibility. Some really basic stuff that should allow people with some MongoDB knowledge to see how easy it is to connect to Informix and manage some data on it

Versão Portuguesa:

Como tem sido habitual ultimamente, este artigo chega um pouco tarde... Mas desta vez não foi só a falta de tempo. Eu detesto escrever sobre o que não entendo, e o novo fixpack do Informix (12.10.xC2) é fundamentalmente dedicado a algo que desconheço: Funcionalidades NoSQL.
Mais especificamente é sobre a possibilidade de conectar aplicações MongoDB (ou melhor dizendo, aplicações que utilizem os drivers e API do MongoDB) ao Informix. Num artigo anterior divaguei sobre essa possibilidade e de facto ficou disponível no dia 13 de Setembro (uma sexta-feira, portanto nem todas as sextas-feiras 13 trazem coisas más). Como referi, porque não gosto de escrever sobre coisas que não entendo passei algum tempo destas últimas semanas a aprender um pouco mais sobre o tema. Seria presunção minha assumir que sou agora perito no assunto, mas ao menos consegui ler sobre o assunto, testar algumas coisas, pensar sobre o assunto e discuti-lo com outras pessoas. Por outras palavras, estou quase tão ignorante como anteriormente, mas sinto-me muito mais confiante :)
Antes de abordar a lista de novas funcionalidades como é hábito nos artigos sobre os novos fixpacks, deixe-me tentar explicar qual é a minha perceção atual sobre o tema:
Com o aparecimento de sites globais, com milhões de utilizadores, emergiu uma necessidade de escalabilidade para além da perceção normal que nós, meros membros do pessoal de TI de companhias com negócios tradicionais (locais ou internacionais), nem sequer assimilamos. Para ambientes como Google, Twitter, Facebook etc., os repositórios relacionais tradicionais, ou com abordagens tradicionais, não poderiam suportar a escalabilidade, flexibilidade e tempos de resposta necessários. Quererá isso dizer que não são boas? De forma nenhuma.... Apenas quer dizer que foram criadas para resolver problemas diferentes. Nota: Em alguns casos são usados repositórios tradicionais mas numa arquitetura totalmente diferente do habitual.
Assim, uma nova espécie de repositórios foi sendo desenvolvida. Muitos novos nomes, como o BigTable, MongoDB, Cassandra, Redis e muitos outros. A todos se chama habitualmente sistemas "NoSQL", porque não usam nem implementam a linguagem SQL. Mas o facto de serem genericamente referidos como "NoSQL" não significam que sejam iguais entre si. Na verdade têm diferenças muito significativas que levam a que sejam adequados a casos diferentes. São assim repositórios altamente especializados, embora naturalmente haja semelhanças entre alguns, e as preferências pessoais de cada programador ou arquiteto de sistemas leva a escolhas diferentes, tal como nas bases de dados SQL tradicionais.
Mas em que medida são diferentes das bases de dados SQL?, Bom, essencialmente não implementam uma série de coisas que damos como adquiridas. Ao fazê-lo assumem riscos, mas isso permite-lhes oferecer outros níveis de escalabilidade e extrema simplicidade para além do que podemos esperar das "nossas" bases de dados. Uma boa leitura sobre este tema é este artigo sobre o teorema CAP de Eric Brewer. Devo também referir o artigo sobre esta versão do Informix do Ognjen Orel que me indicou o anterior. Recomendo vivamente a leitura de ambos.

Algumas destas bases de dados NoSQL armazenam dados com base em "documentos". O MongoDB em particular armazena um documento JSON (ou BSON onde o "B" vem de "binário") como uma linha numa base de dados tradicional. Estes documentos não têm de ter todos a mesma estrutura (mesmo dentro de uma "coleção" que será o equivalente a uma tabela). Isto elimina os tradicionais problemas de mudança no schema da base de dados. Outro aspeto importante é que estas BDs não implementam joins. E como pode ler no artigo acima, a maioria falha os conceitos ACID. Suponho que neste momento ou está interessado ou chocado (ou ambos). Mas estas são algumas coisas de que os criadores abdicaram para permitir a estes repositórios atingir níveis de escalabilidade para além das expectatvas tradicionais. E fazem-no crescendo horizontalmente, adicionando nós, normalmente implementados no menos dispendioso hardware (tipicamente máquinas x86_64 usando algum tipo de Linux).

Bom, tudo isto é relativamente fácil de entender, e poderá encontrar muita informação que providencia mais detalhes. O próxmo passo será tentar entender ou descobrir porquê, e que tipo de integração a IBM implementou no Informix. Vai o Informix afastar-se da norma SQL? Nem por sombras. Irá isto permitir escalar horizontalmente como estas soluções fazem? No limite, penso que não. Irá permitir ao Informix competir com as soluções NoSQL? A meu ver talvez, em determinadas circunstancias, mas julgo que não em situações extremas de escalabilidade (mais umas vez os exemplos clássicos dos gigantes da Internet, onde várias soluções costumizadas tiveram de ser implementadas)
Mas julgo que o ponto mais importante é ligeiramente diferente. E não é tão fácil de encontrar quanto os detalhes e opções de implementação, mas se procurar cuidadosamente irá encontrar em blogs, opiniões em fóruns etc. Refiro-me à opinião de que embora soluções NoSQL possam ser necessárias ou adequadas a solucionar determinados problemas, as mesmas aplicações muitas vezes tornam-se demasiado complexas e difíceis de manter devido à falta de funcionalidades. Coisas que seriam lineares e fáceis de fazer num RDBMS, tornam-se complexas e logo dispendiosas. Nesses casos seria bom ter uma base de dados tradicional que fornecesse o habitual: garantia de consistência, facilidade de utilização do SQL etc. Isto não significa que o NoSQL tenha sido uma má escolha para esses casos, mas apenas que pode ser bom poder complementá-lo com as coisas "tradicionais". Se pensarmos no assunto parece fazer sentido. NoSQL tornou-se uma necessidade para resolver novos desafios, mas de forma nenhuma devemos esperar que nos mesmos ambientes, os problemas "tradicionais" não existam, e logo a solução tradicional, acessível com a mesma facilidade de programação é importante. Por outro lado, porque não oferecer a flexibilidade de desenvolvimento do MongoDB numambiente relacional clássico? Esta é a minha perspetiva sobre este tema.

Lista de funcionalidades

A lista completa das novas funcionalidades pode ser encontrada aqui: http://pic.dhe.ibm.com/infocenter/informix/v121/topic/com.ibm.po.doc/new_features_ce.htm Vou mencionar apenas algumas que me parecem mais importantes.

  • Melhorias na instalação
    Durante a instalação, se decidirmos criar uma instância, irá conter mais funcionalidades de auto-otimização e ficará pronta para a funcionalidade JSON/BSON
  • Administração
    • Novos alarmes para eventos de falha de rede
      Se o motor não conseguir levantar um dos listeners um novo alarme será despoletado, bem como um assert fail
    • Backups e restores
      • Melhor suporte ao storage manager da IBM, o Tivoli
        O informix permite usar pacotes de maior dimensão na troca de informação entre o onbar e o TSM (ou PSM)
      • Restauro dos ficheiros criticos
        No dia do lançamento desta versão estava de regresso de um workshop num cliente fora de Portugal, onde este problema tinha sido levantado. Previamente, se necessitásse-mos de restaurar os ficheiros criticos via storage mnager era necessário utilizar as ferramentas de backup/restore de filesystem ou funcionalidades não documentadas do onbar. Agora a sintaxe documentada permite obter os ficheiros criticos do storage manager com opções do onbar. Isto foi um requisito para o PSM (Primeary Storage Manager) introduzido na 12.10.xC1
      • timestamps no log de actividade do onbar
        É mais uma correcção.... O onbar escrevia os timestamps errados no seu log de actividade quando informava que as chamadas ao storage manager estavam paradas
  • Performance
    • Operações mais rápidas
      • Alterações in-place em tipos de dados SERIAL
        De SERIAL para SERIAL8 e de BIGINT para BIGINT8 passam agora a ser alterações in-place
      • Queries mais rápidas quando o nível de isolamento é Committed Read Last Committed
        O motor pode agora usar read-ahead e light scans em leituras neste modo de isolamento. Os light scans deixam-me intrigado...
    • Optimização dinâmica
      • A cache de memória privada para os CPU VPs pode ser controlada automaticamente. O parâmetro VP_MEMORY_CACHE_KB será ajustado conforme as necessidades
    • Resolução de problemas
      • Monitorização de contenção de recursos
        Não será uma funcionalidade que promova a visibilidade do Informix ou receba reconhecimento a nível de marketing, mas julgo que será umas das favoritas para clientes actuais. Permite mostras as threads que estão à espera numa condição, juntamente com informação sobre quem as está a bloquear. Essa informação pode incluir um output semelhante ao onstat -g ses juntamente com o stack trace. Deve ser óptimo para entender e recolher evidências para situações de bloqueios no motor. Quase aposto que isto foi um requisito introduzido pelo suporte técnico :)
  • Desenvolvimento aplicacional
    • Compatibilidade JSON
      • JSON
        Esta é a novidade principal desta release. As aplicações MongoDB (ou que utilizem dirvers MongoDB) podem ligar-se ao Informix e gerir documentos JSON/BSON, bem como manipular informação dentro das tabelas clássicas do Informix mas num formato JSON. Incluí também a possibilidade de utilizar vários nós Informix de forma semelhante à que o MongoDB utiliza para distribuir registos (sharding). Esta funcionalidade para processamento distribuído assenta em funcionalidades anteriores e nóvas do Enterprise Replicaction do Informix.
      • JSON no OAT
        Como é usual, o OAT permite gerir as novas funcionalidades
    • Nova sintaxe para queries
      • Joins com lateral references
        Funcionalidade de compatibilidade com o ANSI SQL, para queries que utilizem tabelas derivadas na cláusula FROM
    • Melhorias na pesquisa de texto
      Várias novas funcionalidades e melhorias de performance no datablade BTS (Basic Text Search)
    • Produtos clientes
      • Suporte do IBM Informix .NET Provider a versões do .NET Framework
        Melhor compatibilidade do diriver com as versões mais recentes da framework .NET
    • Novo default
      • Definição de separador para valores fraccionados em tratamento de tipos de daods date-time
        Tenho uma história pessoal com este tema... Basicamente, em versões anteriores, certas utilizações do TO_CHAR() e TO_DATE forçavam a utilização de um "." (ponto), como separador das frações de segundo. Agora podemos especificar se o queremos, ou se queremos um carácter específico. O antigo comportamento era particularmente irritante, pois sendo fácil adicionar um caracter, tirar o ponto era impossível sem truques "feios"
  • Enterprise Replication
    • Configuração facilitada
      • Simplificação nas alterações de schema das tabelas replicadas
      • Configurar e fazer queries sobre dados timeseries numa configuração de grid
    • Configuração
      • Controlo sobre a replicação  de LOBs (large objects)
        Podemos forçar a que uma coluna LOB seja replicada em conjunto com a linha, mesmo que o seu conteúdo não mude
      • Funções customizadas para verificação de consistência
        O utilizador pode criar uma função para substituir a função por omissão para verificação da consistência
    • Sharding
      • Tabelas shard entre servidores de bases de dados
        As linhas podem ser repartidas por vários nós, baseado numa função de hash ou outra expressão (reduzindo assim o volume de dados em cada nó).
        O shard pode definir se a linha original (no servidor onde originalmente foi inserida) é mantida ou apagada depois de ser copiada para o destino. Assim, podemos efetivamente distribuir os dados sem nos preocupar-mos em que nó vão ser inseridos. E como sabemos, desde a versão 11.7 podemos executar uma grid query que obterá as linhas de todos os nós da grid
  • Dados timeseries
    • Melhorias
      • Replicação de dados timeseries com todos os nós de clusters de alta disponibilidade
        Anteriormente apenas o HDR era suportado. Agora tanto os SDS como os RSS juntam-se à festa
      • Ordenação de colunas timeseries nos resultados das queries
      • Melhorias em programas de carregamento de dados timeseries
        Melhorias na API
    • Queries mais rápidas
      • Agregação mais rápida de intervalos de valores timeseries
      • Acessos mais eficientes a tabelas virtuais
        Melhorias em tabelas virtuais construídas sobre tabelas timeseries fragmentadas
      • Aceleração de queries em dados timeseries
  • Warehousing
    • Tipos de dados adicionais
      • Aceleração de queries sobre dados timeseries
      • Carregamento direto de tabelas externas para data marts
Espero escrever mais alguns artigos onde mostre um pouco mais sobre a compatibilidade com MongoDB. Algo realmente básico que possa demonstrar a quem tenha algum conhecimento de MongoDB como é fácil conectar-se ao Informix e manipular dados

Thursday, October 03, 2013

Informix @IOD 2013

This article is written in English and Portuguese (original here)
Este artigo está escrito em Inglês e Português (orginal aqui)

English version:
Information On Demand (IOD) conference 2013 will be held in Las Vegas on November 3-7.
As you would expect Informix portfolio will have a strong presence on the conference and you'll be able to attend 20 technical sessions and hands-on labs. Please check Jerry Keesee note (director of Informix developement) about this.
Naturally the new NoSQL features in 12.10.xC2 will be a big topic. And naturally you'll get access to a lot more sessions about other portfolio areas that you can use with Informix like Guardium, Optim, Cognos and so on...


Versão Portuguesa:
A conferência Information On Demand (IOD) de 2013 terá lugar de 3 a 7 de Novembro em Las Vegas.
Como seria de esperar, o portflio Informix terá uma presença forte na conferência, podendo assistir a 20 sessões técnicas e laboratórios com exercícios. Consulte a nota do Jerry Keesee (director de sedenvolvimento Informix) sobre isto.
Naturalmente as novas funcionalidades NoSQL da versão 12.10.xC2 serão um tópico "quente". Poderá também assistir a muitas mais sessões sobre outros produtos do portfolio IBM que pode usar com o Informix, como o Guardium, o Optim, Cognos e outros...